Skip to contentSkip to conversation

Set error value while device_add() failed.

PATCH New yangsheng 1 participant 1 message Jan 13, 2011 SCSI

lore
Share & tools
lore

yangsheng

author
#0 lore raw

PATCH 1/1 Set error value while device_add() failed.

---
 drivers/scsi/sd.c |    3 ++-
 1 files changed, 2 insertions(+), 1 deletions(-)
drivers/scsi/sd.c +2 -1
index d21dd17..2ca5250 100644
@@ -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);
Signature · 1 line
1.7.2.3