* [PATCH] ntnic: remove unnecessary null free check
@ 2024-10-23 5:47 Stephen Hemminger
0 siblings, 0 replies; only message in thread
From: Stephen Hemminger @ 2024-10-23 5:47 UTC (permalink / raw)
To: dev; +Cc: Stephen Hemminger, okl-plv, Christian Koue Muf, Serhii Iliushyk
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")
Cc: okl-plv@napatech.com
Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
---
drivers/net/ntnic/nthw/flow_api/flow_api.c | 3 +--
1 file changed, 1 insertion(+), 2 deletions(-)
diff --git a/drivers/net/ntnic/nthw/flow_api/flow_api.c b/drivers/net/ntnic/nthw/flow_api/flow_api.c
index 34e84559eb..ea3ef65ecb 100644
--- a/drivers/net/ntnic/nthw/flow_api/flow_api.c
+++ b/drivers/net/ntnic/nthw/flow_api/flow_api.c
@@ -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)
--
2.45.2
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2024-10-23 5:47 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2024-10-23 5:47 [PATCH] ntnic: remove unnecessary null free check Stephen Hemminger
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).