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

* Re: [patch] sd: fix an error return in probe()
  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
  1 sibling, 0 replies; 3+ messages in thread
From: Dan Carpenter @ 2015-04-14 14:28 UTC (permalink / raw)
  To: James E.J. Bottomley; +Cc: linux-scsi, kernel-janitors

I almost accidentally sent this one again.  I still think it's correct.

regards,
dan carpenter

On Mon, Jan 19, 2015 at 05:41:12PM +0300, Dan Carpenter wrote:
> 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);
> --
> To unsubscribe from this list: send the line "unsubscribe kernel-janitors" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html

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

* Re: [patch] sd: fix an error return in probe()
  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
  1 sibling, 0 replies; 3+ messages in thread
From: Tomas Henzl @ 2015-04-16 12:23 UTC (permalink / raw)
  To: Dan Carpenter, James E.J. Bottomley; +Cc: linux-scsi, kernel-janitors

On 01/19/2015 03:41 PM, Dan Carpenter wrote:
> 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);
> --
> 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

Reviewed-by: Tomas Henzl <thenzl@redhat.com>

Tomas


^ permalink raw reply	[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).