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>] [day] [month] [year] [list]
Date:	Wed, 2 Sep 2015 21:43:13 +0900
From:	Alexandre Courbot <gnurou@...il.com>
To:	Nicholas Krause <xerofoify@...il.com>
Cc:	Linus Walleij <linus.walleij@...aro.org>,
	"linux-gpio@...r.kernel.org" <linux-gpio@...r.kernel.org>,
	Linux Kernel Mailing List <linux-kernel@...r.kernel.org>
Subject: Re: [PATCH] gpio:Fix error checking in the function device_pca957x_init

Nit: please don't forget a space after "gpio:" in your subject line.

On Thu, Aug 27, 2015 at 6:52 AM, Nicholas Krause <xerofoify@...il.com> wrote:
> This fixes error checking in the function device_pca957x_init
> to properly check and return error code values from the calls
> to the function pca953x_write_regs if they fail as to properly
> signal callers when a error occurs due a failure when writing
> registers for this gpio based device.
>
> Signed-off-by: Nicholas Krause <xerofoify@...il.com>
> ---
>  drivers/gpio/gpio-pca953x.c | 8 ++++++--
>  1 file changed, 6 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/gpio/gpio-pca953x.c b/drivers/gpio/gpio-pca953x.c
> index 50caeb1..4e5745d 100644
> --- a/drivers/gpio/gpio-pca953x.c
> +++ b/drivers/gpio/gpio-pca953x.c
> @@ -635,11 +635,15 @@ static int device_pca957x_init(struct pca953x_chip *chip, u32 invert)
>                 memset(val, 0xFF, NBANK(chip));
>         else
>                 memset(val, 0, NBANK(chip));
> -       pca953x_write_regs(chip, PCA957X_INVRT, val);
> +       ret = pca953x_write_regs(chip, PCA957X_INVRT, val);
> +       if (ret)
> +               goto out;
>
>         /* To enable register 6, 7 to control pull up and pull down */
>         memset(val, 0x02, NBANK(chip));
> -       pca953x_write_regs(chip, PCA957X_BKEN, val);
> +       ret = pca953x_write_regs(chip, PCA957X_BKEN, val);
> +       if (ret)
> +               goto out;

Ok, cannot hurt.

Reviewed-by: Alexandre Courbot <acourbot@...dia.com>
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ