Commit 524e001b authored by Qiheng Lin's avatar Qiheng Lin Committed by Jakub Kicinski

cxgb4: remove unneeded if-null-free check

Eliminate the following coccicheck warning:

drivers/net/ethernet/chelsio/cxgb4/cxgb4_tc_u32.c:529:3-9: WARNING:
 NULL check before some freeing functions is not needed.
drivers/net/ethernet/chelsio/cxgb4/cxgb4_tc_u32.c:533:2-8: WARNING:
 NULL check before some freeing functions is not needed.
drivers/net/ethernet/chelsio/cxgb4/cxgb4_cudbg.c:161:2-7: WARNING:
 NULL check before some freeing functions is not needed.
drivers/net/ethernet/chelsio/cxgb4/clip_tbl.c:327:3-9: WARNING:
 NULL check before some freeing functions is not needed.
Signed-off-by: default avatarQiheng Lin <linqiheng@huawei.com>
Link: https://lore.kernel.org/r/20210409115339.4598-1-linqiheng@huawei.comSigned-off-by: default avatarJakub Kicinski <kuba@kernel.org>
parent 6597b5c2
...@@ -323,8 +323,7 @@ void t4_cleanup_clip_tbl(struct adapter *adap) ...@@ -323,8 +323,7 @@ void t4_cleanup_clip_tbl(struct adapter *adap)
struct clip_tbl *ctbl = adap->clipt; struct clip_tbl *ctbl = adap->clipt;
if (ctbl) { if (ctbl) {
if (ctbl->cl_list) kvfree(ctbl->cl_list);
kvfree(ctbl->cl_list);
kvfree(ctbl); kvfree(ctbl);
} }
} }
......
...@@ -157,8 +157,7 @@ static int cudbg_alloc_compress_buff(struct cudbg_init *pdbg_init) ...@@ -157,8 +157,7 @@ static int cudbg_alloc_compress_buff(struct cudbg_init *pdbg_init)
static void cudbg_free_compress_buff(struct cudbg_init *pdbg_init) static void cudbg_free_compress_buff(struct cudbg_init *pdbg_init)
{ {
if (pdbg_init->compress_buff) vfree(pdbg_init->compress_buff);
vfree(pdbg_init->compress_buff);
} }
int cxgb4_cudbg_collect(struct adapter *adap, void *buf, u32 *buf_size, int cxgb4_cudbg_collect(struct adapter *adap, void *buf, u32 *buf_size,
......
...@@ -524,13 +524,9 @@ struct cxgb4_tc_u32_table *cxgb4_init_tc_u32(struct adapter *adap) ...@@ -524,13 +524,9 @@ struct cxgb4_tc_u32_table *cxgb4_init_tc_u32(struct adapter *adap)
out_no_mem: out_no_mem:
for (i = 0; i < t->size; i++) { for (i = 0; i < t->size; i++) {
struct cxgb4_link *link = &t->table[i]; struct cxgb4_link *link = &t->table[i];
kvfree(link->tid_map);
if (link->tid_map)
kvfree(link->tid_map);
} }
kvfree(t);
if (t)
kvfree(t);
return NULL; return NULL;
} }
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment