[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <54D3EE2B.50705@users.sourceforge.net>
Date: Thu, 05 Feb 2015 23:26:51 +0100
From: SF Markus Elfring <elfring@...rs.sourceforge.net>
To: James Smart <james.smart@...lex.com>,
"James E. J. Bottomley" <JBottomley@...allels.com>,
linux-scsi@...r.kernel.org
CC: LKML <linux-kernel@...r.kernel.org>,
kernel-janitors@...r.kernel.org,
Julia Lawall <julia.lawall@...6.fr>
Subject: [PATCH 1/2] SCSI-lpfc: Delete an unnecessary check before the function
call "kfree"
From: Markus Elfring <elfring@...rs.sourceforge.net>
Date: Thu, 5 Feb 2015 22:45:02 +0100
The kfree() function tests whether its argument is NULL and then
returns immediately. Thus the test around the call is not needed.
This issue was detected by using the Coccinelle software.
Signed-off-by: Markus Elfring <elfring@...rs.sourceforge.net>
---
drivers/scsi/lpfc/lpfc_bsg.c | 4 +---
1 file changed, 1 insertion(+), 3 deletions(-)
diff --git a/drivers/scsi/lpfc/lpfc_bsg.c b/drivers/scsi/lpfc/lpfc_bsg.c
index a7bf359..1af783a 100644
--- a/drivers/scsi/lpfc/lpfc_bsg.c
+++ b/drivers/scsi/lpfc/lpfc_bsg.c
@@ -1261,9 +1261,7 @@ lpfc_bsg_hba_set_event(struct fc_bsg_job *job)
return 0; /* call job done later */
job_error:
- if (dd_data != NULL)
- kfree(dd_data);
-
+ kfree(dd_data);
job->dd_data = NULL;
return rc;
}
--
2.2.2
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists