Skip to contentSkip to conversation

drivers/scsi/mpt2sas/mpt2sas_transport.c: add missing sas_phy_free

PATCH In review Julia Lawall 2 participants 2 messages Aug 10, 2011 – Aug 30, 2011

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 drivers/scsi/mpt2sas/mpt2sas_transport.c: add missing sas_phy_free

From: Julia Lawall <[email protected]>

In each case, sas_phy_add has not yet been successfully applied, so use sas_phy_free to free phy.

---
 drivers/scsi/mpt2sas/mpt2sas_transport.c |    2 ++
 1 file changed, 2 insertions(+)
drivers/scsi/mpt2sas/mpt2sas_transport.c +2 -0
index 15c7980..762f05e 100644
@@ -857,6 +857,7 @@ mpt2sas_transport_add_host_phy(struct MPT2SAS_ADAPTER *ioc, struct _sas_phy
 	    &mpt2sas_phy->identify))) {
 		printk(MPT2SAS_ERR_FMT "failure at %s:%d/%s()!\n",
 		    ioc->name, __FILE__, __LINE__, __func__);
+		sas_phy_free(phy);
 		return -1;
 	}
 	phy->identify = mpt2sas_phy->identify;
@@ -923,6 +924,7 @@ mpt2sas_transport_add_expander_phy(struct MPT2SAS_ADAPTER *ioc, struct _sas_phy
 	    &mpt2sas_phy->identify))) {
 		printk(MPT2SAS_ERR_FMT "failure at %s:%d/%s()!\n",
 		    ioc->name, __FILE__, __LINE__, __func__);
+		sas_phy_free(phy);
 		return -1;
 	}
 	phy->identify = mpt2sas_phy->identify;
#1 lore raw

The patch seem to be fine. Please consider this patch as Acked-by: "Nandigama, Nagalakshmi" <[email protected]>

Regards,
Nagalakshmi

-----Original Message-----
From: Julia Lawall [mailto:[email protected]]
Sent: Wednesday, August 10, 2011 5:02 PM
To: James E.J. Bottomley
Cc: [email protected]; Desai, Kashyap; James Bottomley; [email protected]; [email protected]
Subject: [PATCH] drivers/scsi/mpt2sas/mpt2sas_transport.c: add missing sas_phy_free

From: Julia Lawall <[email protected]>

In each case, sas_phy_add has not yet been successfully applied, so use sas_phy_free to free phy.

---
 drivers/scsi/mpt2sas/mpt2sas_transport.c |    2 ++
 1 file changed, 2 insertions(+)
drivers/scsi/mpt2sas/mpt2sas_transport.c +2 -0
index 15c7980..762f05e 100644
@@ -857,6 +857,7 @@ mpt2sas_transport_add_host_phy(struct MPT2SAS_ADAPTER *ioc, struct _sas_phy
 	    &mpt2sas_phy->identify))) {
 		printk(MPT2SAS_ERR_FMT "failure at %s:%d/%s()!\n",
 		    ioc->name, __FILE__, __LINE__, __func__);
+		sas_phy_free(phy);
 		return -1;
 	}
 	phy->identify = mpt2sas_phy->identify;
@@ -923,6 +924,7 @@ mpt2sas_transport_add_expander_phy(struct MPT2SAS_ADAPTER *ioc, struct _sas_phy
 	    &mpt2sas_phy->identify))) {
 		printk(MPT2SAS_ERR_FMT "failure at %s:%d/%s()!\n",
 		    ioc->name, __FILE__, __LINE__, __func__);
+		sas_phy_free(phy);
 		return -1;
 	}
 	phy->identify = mpt2sas_phy->identify;