From 4e616593b52001fa8dfeac2506be613f98d8feda Mon Sep 17 00:00:00 2001 From: Caleb Sander Mateos Date: Tue, 16 Jul 2024 09:59:29 -0600 Subject: [PATCH] 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 --- util/cleanup.h | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/util/cleanup.h b/util/cleanup.h index 0819523d..f2acde0d 100644 --- a/util/cleanup.h +++ b/util/cleanup.h @@ -38,8 +38,7 @@ static inline void cleanup_fd(int *fd) static inline void cleanup_nvme_root(nvme_root_t *r) { - if (r) - nvme_free_tree(*r); + nvme_free_tree(*r); } #define _cleanup_nvme_root_ __cleanup__(cleanup_nvme_root) -- 2.50.1