[prev in list] [next in list] [prev in thread] [next in thread] 

List:       linux-scsi
Subject:    Re: [PATCH] cleanup after a discovery error
From:       malahal () us ! ibm ! com
Date:       2006-10-30 20:23:02
Message-ID: 20061030202302.GA22870 () us ! ibm ! com
[Download RAW message or body]

James Bottomley [James.Bottomley@SteelEye.com] 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@us.ibm.com>

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@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic