forked from Minki/linux
sd: fix an error return in probe()
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> Reviewed-by: Tomas Henzl <thenzl@redhat.com> Signed-off-by: James Bottomley <JBottomley@Odin.com>
This commit is contained in:
parent
ef10b16948
commit
dee0586e15
@ -2988,7 +2988,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);
|
||||
|
Loading…
Reference in New Issue
Block a user