Skip to content

Commit 3875721

Browse files
Wei Yongjunbrgl
authored andcommitted
gpiolib: Fix error return code in gpiolib_dev_init()
Fix to return a negative error code from the error handling case instead of 0, as done elsewhere in this function. Fixes: 4731210 ("gpiolib: Bind gpio_device to a driver to enable fw_devlink=on by default") Reported-by: Hulk Robot <hulkci@huawei.com> Signed-off-by: Wei Yongjun <weiyongjun1@huawei.com> Signed-off-by: Bartosz Golaszewski <bgolaszewski@baylibre.com>
1 parent b41ba2e commit 3875721

1 file changed

Lines changed: 2 additions & 1 deletion

File tree

drivers/gpio/gpiolib.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4256,7 +4256,8 @@ static int __init gpiolib_dev_init(void)
42564256
return ret;
42574257
}
42584258

4259-
if (driver_register(&gpio_stub_drv) < 0) {
4259+
ret = driver_register(&gpio_stub_drv);
4260+
if (ret < 0) {
42604261
pr_err("gpiolib: could not register GPIO stub driver\n");
42614262
bus_unregister(&gpio_bus_type);
42624263
return ret;

0 commit comments

Comments
 (0)