Skip to content

Commit 4e61659

Browse files
calebsanderigaw
authored andcommitted
util: remove unnecessary NULL check in cleanup_nvme_root()
cleanup_nvme_root() is checking whether the passed pointer is non-NULL, but since the pointer is to a local variable, this will always be true. Therefore, remove the check and always call nvme_free_tree(). Signed-off-by: Caleb Sander Mateos <csander@purestorage.com>
1 parent 648114f commit 4e61659

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

util/cleanup.h

+1-2
Original file line numberDiff line numberDiff line change
@@ -38,8 +38,7 @@ static inline void cleanup_fd(int *fd)
3838

3939
static inline void cleanup_nvme_root(nvme_root_t *r)
4040
{
41-
if (r)
42-
nvme_free_tree(*r);
41+
nvme_free_tree(*r);
4342
}
4443
#define _cleanup_nvme_root_ __cleanup__(cleanup_nvme_root)
4544

0 commit comments

Comments
 (0)