mirror of
https://github.com/raspberrypi/linux.git
synced 2025-12-06 10:00:17 +00:00
driver core: Fix error return code in really_probe()
[ Upstream commitf04948dea2] In the case of error handling, the error code returned by the subfunction should be propagated instead of 0. Fixes:1901fb2604("Driver core: fix "driver" symlink timing") Fixes:23b6904442("driver core: add dev_groups to all drivers") Fixes:8fd456ec0c("driver core: Add state_synced sysfs file for devices that support it") Reported-by: Hulk Robot <hulkci@huawei.com> Signed-off-by: Zhen Lei <thunder.leizhen@huawei.com> Link: https://lore.kernel.org/r/20210707074301.2722-1-thunder.leizhen@huawei.com Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org> Signed-off-by: Sasha Levin <sashal@kernel.org>
This commit is contained in:
committed by
Greg Kroah-Hartman
parent
d99c820a7a
commit
dbd9f85376
@@ -580,7 +580,8 @@ re_probe:
|
|||||||
goto probe_failed;
|
goto probe_failed;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (driver_sysfs_add(dev)) {
|
ret = driver_sysfs_add(dev);
|
||||||
|
if (ret) {
|
||||||
pr_err("%s: driver_sysfs_add(%s) failed\n",
|
pr_err("%s: driver_sysfs_add(%s) failed\n",
|
||||||
__func__, dev_name(dev));
|
__func__, dev_name(dev));
|
||||||
goto probe_failed;
|
goto probe_failed;
|
||||||
@@ -602,16 +603,19 @@ re_probe:
|
|||||||
goto probe_failed;
|
goto probe_failed;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (device_add_groups(dev, drv->dev_groups)) {
|
ret = device_add_groups(dev, drv->dev_groups);
|
||||||
|
if (ret) {
|
||||||
dev_err(dev, "device_add_groups() failed\n");
|
dev_err(dev, "device_add_groups() failed\n");
|
||||||
goto dev_groups_failed;
|
goto dev_groups_failed;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (dev_has_sync_state(dev) &&
|
if (dev_has_sync_state(dev)) {
|
||||||
device_create_file(dev, &dev_attr_state_synced)) {
|
ret = device_create_file(dev, &dev_attr_state_synced);
|
||||||
|
if (ret) {
|
||||||
dev_err(dev, "state_synced sysfs add failed\n");
|
dev_err(dev, "state_synced sysfs add failed\n");
|
||||||
goto dev_sysfs_state_synced_failed;
|
goto dev_sysfs_state_synced_failed;
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
if (test_remove) {
|
if (test_remove) {
|
||||||
test_remove = false;
|
test_remove = false;
|
||||||
|
|||||||
Reference in New Issue
Block a user