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] [thread-next>] [day] [month] [year] [list]
Date:	Thu, 9 Dec 2010 21:15:33 +0800
From:	Eric Miao <eric.y.miao@...il.com>
To:	Aaro Koskinen <aaro.koskinen@...ia.com>
Cc:	akpm@...ux-foundation.org, linux-kernel@...r.kernel.org
Subject: Re: [PATCH] gpiolib: gpio_request_one(): add missing gpio_free()

On Thu, Dec 9, 2010 at 8:58 PM, Aaro Koskinen <aaro.koskinen@...ia.com> wrote:
> If GPIO request succeeds, but configuration fails, it should be released.
>
> Signed-off-by: Aaro Koskinen <aaro.koskinen@...ia.com>

Acked-by: Eric Miao <eric.miao@...onical.com>

> ---
>  drivers/gpio/gpiolib.c |    3 +++
>  1 files changed, 3 insertions(+), 0 deletions(-)
>
> diff --git a/drivers/gpio/gpiolib.c b/drivers/gpio/gpiolib.c
> index 21da9c1..649550e 100644
> --- a/drivers/gpio/gpiolib.c
> +++ b/drivers/gpio/gpiolib.c
> @@ -1281,6 +1281,9 @@ int gpio_request_one(unsigned gpio, unsigned long flags, const char *label)
>                err = gpio_direction_output(gpio,
>                                (flags & GPIOF_INIT_HIGH) ? 1 : 0);
>
> +       if (err)
> +               gpio_free(gpio);
> +
>        return err;
>  }
>  EXPORT_SYMBOL_GPL(gpio_request_one);
> --
> 1.5.6.5
>
>
--
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