[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-Id: <20161119174259.20344-1-lambert.quentin@gmail.com>
Date: Sat, 19 Nov 2016 18:42:59 +0100
From: Quentin Lambert <lambert.quentin@...il.com>
To: John Garry <john.garry@...wei.com>,
"James E.J. Bottomley" <jejb@...ux.vnet.ibm.com>,
"Martin K. Petersen" <martin.petersen@...cle.com>,
linux-scsi@...r.kernel.org, linux-kernel@...r.kernel.org,
kernel-janitors@...r.kernel.org
Cc: Quentin Lambert <lambert.quentin@...il.com>
Subject: [PATCH] scsi: hisi_sas: Add a missing call to kfree
Most error branches following the call to hisi_sas_shost_alloc contain
a call to kfree. This patch add these calls where they are
missing.
This issue was found with Hector.
Signed-off-by: Quentin Lambert <lambert.quentin@...il.com>
---
drivers/scsi/hisi_sas/hisi_sas_main.c | 6 ++++--
1 file changed, 4 insertions(+), 2 deletions(-)
--- a/drivers/scsi/hisi_sas/hisi_sas_main.c
+++ b/drivers/scsi/hisi_sas/hisi_sas_main.c
@@ -1503,8 +1503,10 @@ int hisi_sas_probe(struct platform_devic
arr_phy = devm_kcalloc(dev, phy_nr, sizeof(void *), GFP_KERNEL);
arr_port = devm_kcalloc(dev, port_nr, sizeof(void *), GFP_KERNEL);
- if (!arr_phy || !arr_port)
- return -ENOMEM;
+ if (!arr_phy || !arr_port) {
+ rc = -ENOMEM;
+ goto err_out_ha;
+ }
sha->sas_phy = arr_phy;
sha->sas_port = arr_port;
Powered by blists - more mailing lists