Skip to contentSkip to conversation

ntnic: remove unnecessary null free check

PATCH New Stephen Hemminger 1 participant 1 message Oct 23, 2024 Network drivers

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 ntnic: remove unnecessary null free check

No need for a if() check before calling free() since NULL is allowed. Found by nullfree.cocci.

Fixes 1d3f62a0c4f1 ("net/ntnic: add base init and deinit of flow API")
---
 drivers/net/ntnic/nthw/flow_api/flow_api.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)
drivers/net/ntnic/nthw/flow_api/flow_api.c +1 -2
index 34e84559eb..ea3ef65ecb 100644
@@ -205,8 +205,7 @@ static void done_resource_elements(struct flow_nic_dev *ndev, enum res_type_e re
 {
 	assert(ndev);
 
-	if (ndev->res[res_type].alloc_bm)
-		free(ndev->res[res_type].alloc_bm);
+	free(ndev->res[res_type].alloc_bm);
 }
 
 static void list_insert_flow_nic(struct flow_nic_dev *ndev)
Signature · 1 line
2.45.2