public inbox for linux-scsi@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] Set error value while device_add() failed.
@ 2011-01-13 18:48 yangsheng
  0 siblings, 0 replies; only message in thread
From: yangsheng @ 2011-01-13 18:48 UTC (permalink / raw)
  To: linux-scsi; +Cc: linux-kernel, akpm, yangsheng

Signed-off-by: yangsheng <sickamd@gmail.com>
---
 drivers/scsi/sd.c |    3 ++-
 1 files changed, 2 insertions(+), 1 deletions(-)

diff --git a/drivers/scsi/sd.c b/drivers/scsi/sd.c
index d21dd17..2ca5250 100644
--- a/drivers/scsi/sd.c
+++ b/drivers/scsi/sd.c
@@ -2474,7 +2474,8 @@ static int sd_probe(struct device *dev)
 	sdkp->dev.class = &sd_disk_class;
 	dev_set_name(&sdkp->dev, dev_name(dev));
 
-	if (device_add(&sdkp->dev))
+	error = device_add(&sdkp->dev);
+	if (error)
 		goto out_free_index;
 
 	get_device(dev);
-- 
1.7.2.3


^ permalink raw reply related	[flat|nested] only message in thread

only message in thread, other threads:[~2011-01-13 18:49 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-01-13 18:48 [PATCH] Set error value while device_add() failed yangsheng

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox