From: Dan Carpenter <dan.carpenter@oracle.com>
To: "James E.J. Bottomley" <JBottomley@parallels.com>
Cc: linux-scsi@vger.kernel.org, kernel-janitors@vger.kernel.org
Subject: [patch] sd: fix an error return in probe()
Date: Mon, 19 Jan 2015 14:41:12 +0000 [thread overview]
Message-ID: <20150119144112.GB19086@mwanda> (raw)
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);
WARNING: multiple messages have this Message-ID (diff)
From: Dan Carpenter <dan.carpenter@oracle.com>
To: "James E.J. Bottomley" <JBottomley@parallels.com>
Cc: linux-scsi@vger.kernel.org, kernel-janitors@vger.kernel.org
Subject: [patch] sd: fix an error return in probe()
Date: Mon, 19 Jan 2015 17:41:12 +0300 [thread overview]
Message-ID: <20150119144112.GB19086@mwanda> (raw)
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);
next reply other threads:[~2015-01-19 14:41 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-01-19 14:41 Dan Carpenter [this message]
2015-01-19 14:41 ` [patch] sd: fix an error return in probe() Dan Carpenter
2015-04-14 14:28 ` Dan Carpenter
2015-04-14 14:28 ` Dan Carpenter
2015-04-16 12:23 ` Tomas Henzl
2015-04-16 12:23 ` Tomas Henzl
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20150119144112.GB19086@mwanda \
--to=dan.carpenter@oracle.com \
--cc=JBottomley@parallels.com \
--cc=kernel-janitors@vger.kernel.org \
--cc=linux-scsi@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.