Re: [PATCH] cleanup after a discovery error

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

 



James Bottomley [James.Bottomley@xxxxxxxxxxxx] wrote:
> 
> This is a bit of a layering violation
> 
> if the various discover functions are going to return an error, I think
> it's their job to clean up whatever they did before returning.
> 
> James

Hope this works better.
Signed-off-by: Malahal Naineni <malahal@xxxxxxxxxx>

diff -r 80de69a94159 drivers/scsi/libsas/sas_discover.c
--- a/drivers/scsi/libsas/sas_discover.c	Wed Oct 25 13:28:31 2006 -0700
+++ b/drivers/scsi/libsas/sas_discover.c	Mon Oct 30 11:55:21 2006 -0800
@@ -684,6 +684,11 @@ static void sas_discover_domain(void *da
 	}
 
 	if (error) {
+		sas_rphy_delete(port->port_dev->rphy);
+		port->port_dev->rphy = NULL;
+		spin_lock(&port->dev_list_lock);
+		list_del_init(&port->port_dev->dev_list_node);
+		spin_unlock(&port->dev_list_lock);
 		kfree(port->port_dev); /* not kobject_register-ed yet */
 		port->port_dev = NULL;
 	}
-
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