drivers/scsi/qla2xxx/qla_iocb.c:2022:2-7: WARNING: NULL check before freeing 
functions like kfree, debugfs_remove, debugfs_remove_recursive or usb_free_urb 
is not needed. Maybe consider reorganizing relevant code to avoid passing NULL 
values.

 NULL check before some freeing functions is not needed.

 Based on checkpatch warning
 "kfree(NULL) is safe this check is probably not required"
 and kfreeaddr.cocci by Julia Lawall.

Generated by: scripts/coccinelle/free/ifnullfree.cocci

CC: Himanshu Madhani <himanshu.madh...@qlogic.com>
Signed-off-by: Fengguang Wu <fengguang...@intel.com>
---

 qla_iocb.c |    3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

--- a/drivers/scsi/qla2xxx/qla_iocb.c
+++ b/drivers/scsi/qla2xxx/qla_iocb.c
@@ -2018,8 +2018,7 @@ qla2x00_els_dcmd_sp_free(void *ptr, void
        srb_t *sp = (srb_t *)data;
        struct srb_iocb *elsio = &sp->u.iocb_cmd;
 
-       if (sp->fcport)
-               kfree(sp->fcport);
+       kfree(sp->fcport);
 
        if (elsio->u.els_logo.els_logo_pyld)
                dma_free_coherent(&ha->pdev->dev, DMA_POOL_SIZE,
--
To unsubscribe from this list: send the line "unsubscribe linux-scsi" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to