lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Date:   Mon, 11 Mar 2019 10:31:43 +0100
From:   Bartosz Golaszewski <bgolaszewski@...libre.com>
To:     Kangjie Lu <kjlu@....edu>
Cc:     pakki001@....edu, Linus Walleij <linus.walleij@...aro.org>,
        linux-gpio <linux-gpio@...r.kernel.org>,
        LKML <linux-kernel@...r.kernel.org>
Subject: Re: [PATCH] gpio: add a check for the return value of ida_simple_get fails

sob., 9 mar 2019 o 05:08 Kangjie Lu <kjlu@....edu> napisaƂ(a):
>
> ida_simple_get may fail and return a negative error number.
> The fix checks its return value; if it fails, go to err_destroy.
>
> Signed-off-by: Kangjie Lu <kjlu@....edu>
> ---
>  drivers/gpio/gpio-exar.c | 2 ++
>  1 file changed, 2 insertions(+)
>
> diff --git a/drivers/gpio/gpio-exar.c b/drivers/gpio/gpio-exar.c
> index 0ecd2369c2ca..a09d2f9ebacc 100644
> --- a/drivers/gpio/gpio-exar.c
> +++ b/drivers/gpio/gpio-exar.c
> @@ -148,6 +148,8 @@ static int gpio_exar_probe(struct platform_device *pdev)
>         mutex_init(&exar_gpio->lock);
>
>         index = ida_simple_get(&ida_index, 0, 0, GFP_KERNEL);
> +       if (index < 0)
> +               goto err_destroy;
>
>         sprintf(exar_gpio->name, "exar_gpio%d", index);
>         exar_gpio->gpio_chip.label = exar_gpio->name;
> --
> 2.17.1
>

Applied, I Cc'ed stable and will send it to Linus Walleij once
v5.1-rc1 is tagged.

Bart

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ