kernel-janitors.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [patch] sd: fix an error return in probe()
@ 2015-01-19 14:41 Dan Carpenter
  2015-04-14 14:28 ` Dan Carpenter
  2015-04-16 12:23 ` Tomas Henzl
  0 siblings, 2 replies; 3+ messages in thread
From: Dan Carpenter @ 2015-01-19 14:41 UTC (permalink / raw)
  To: James E.J. Bottomley; +Cc: linux-scsi, kernel-janitors

If device_add() fails then it should return the error code but instead
the current code returns success.

Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>

diff --git a/drivers/scsi/sd.c b/drivers/scsi/sd.c
index ebf35cb6..75a0b55 100644
--- a/drivers/scsi/sd.c
+++ b/drivers/scsi/sd.c
@@ -3019,7 +3019,8 @@ static int sd_probe(struct device *dev)
 	sdkp->dev.class = &sd_disk_class;
 	dev_set_name(&sdkp->dev, "%s", dev_name(dev));
 
-	if (device_add(&sdkp->dev))
+	error = device_add(&sdkp->dev);
+	if (error)
 		goto out_free_index;
 
 	get_device(dev);

^ permalink raw reply related	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2015-04-16 12:23 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-01-19 14:41 [patch] sd: fix an error return in probe() Dan Carpenter
2015-04-14 14:28 ` Dan Carpenter
2015-04-16 12:23 ` Tomas Henzl

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).