Re: [PATCH] scsi: hisi_sas: Add a missing call to kfree

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On 19/11/2016 17:42, Quentin Lambert wrote:
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.

I think that this patch is fine. However I have noticed that we should do a call to hisi_sas_free() for this failure, and later failures in the probe.

I can generate a patch for this.

Cheers,
John


Signed-off-by: Quentin Lambert <lambert.quentin@xxxxxxxxx>

---
 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;

.



--
To unsubscribe from this list: send the line "unsubscribe linux-scsi" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html



[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [SCSI Target Devel]     [Linux SCSI Target Infrastructure]     [Kernel Newbies]     [IDE]     [Security]     [Git]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux ATA RAID]     [Linux IIO]     [Samba]     [Device Mapper]
  Powered by Linux