提交 dee0586e 编写于 作者: D Dan Carpenter 提交者: James Bottomley

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: NDan Carpenter <dan.carpenter@oracle.com>
Reviewed-by: NTomas Henzl <thenzl@redhat.com>
Signed-off-by: NJames Bottomley <JBottomley@Odin.com>
上级 ef10b169
......@@ -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);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册