[PATCH v2 10/83] examples/vhost_blk: remove unnecessary NULL checks

Stephen Hemminger stephen at networkplumber.org
Mon Jan 24 18:46:06 CET 2022


Remove redundant NULL pointer checks before free functions
found by nullfree.cocci

Signed-off-by: Stephen Hemminger <stephen at networkplumber.org>
---
 examples/vhost_blk/vhost_blk.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/examples/vhost_blk/vhost_blk.c b/examples/vhost_blk/vhost_blk.c
index feadacc62ee5..2cab1e6994fe 100644
--- a/examples/vhost_blk/vhost_blk.c
+++ b/examples/vhost_blk/vhost_blk.c
@@ -849,8 +849,7 @@ static void
 vhost_blk_ctrlr_destroy(struct vhost_blk_ctrlr *ctrlr)
 {
 	if (ctrlr->bdev != NULL) {
-		if (ctrlr->bdev->data != NULL)
-			rte_free(ctrlr->bdev->data);
+		rte_free(ctrlr->bdev->data);
 
 		rte_free(ctrlr->bdev);
 	}
-- 
2.30.2



More information about the dev mailing list