Re: [PATCH -next] gpiolib: Fix error return code in gpiolib_dev_init()

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Fri, Mar 12, 2021 at 8:55 AM 'Wei Yongjun <weiyongjun1@xxxxxxxxxx> wrote:
>
> From: Wei Yongjun <weiyongjun1@xxxxxxxxxx>
>
> Fix to return a negative error code from the error handling
> case instead of 0, as done elsewhere in this function.
>
> Fixes: 4731210c09f5 ("gpiolib: Bind gpio_device to a driver to enable fw_devlink=on by default")
> Reported-by: Hulk Robot <hulkci@xxxxxxxxxx>
> Signed-off-by: Wei Yongjun <weiyongjun1@xxxxxxxxxx>
> ---
>  drivers/gpio/gpiolib.c | 3 ++-
>  1 file changed, 2 insertions(+), 1 deletion(-)
>
> diff --git a/drivers/gpio/gpiolib.c b/drivers/gpio/gpiolib.c
> index cee4333f8ac7..18086262dd48 100644
> --- a/drivers/gpio/gpiolib.c
> +++ b/drivers/gpio/gpiolib.c
> @@ -4242,7 +4242,8 @@ static int __init gpiolib_dev_init(void)
>                 return ret;
>         }
>
> -       if (driver_register(&gpio_stub_drv) < 0) {
> +       ret = driver_register(&gpio_stub_drv);
> +       if (ret < 0) {
>                 pr_err("gpiolib: could not register GPIO stub driver\n");
>                 bus_unregister(&gpio_bus_type);
>                 return ret;
>

Applied to fixes, thanks!

Bartosz



[Index of Archives]     [Linux SPI]     [Linux Kernel]     [Linux ARM (vger)]     [Linux ARM MSM]     [Linux Omap]     [Linux Arm]     [Linux Tegra]     [Fedora ARM]     [Linux for Samsung SOC]     [eCos]     [Linux Fastboot]     [Gcc Help]     [Git]     [DCCP]     [IETF Announce]     [Security]     [Linux MIPS]     [Yosemite Campsites]

  Powered by Linux