[U-Boot] [PATCH] tegra: gpio: fix null label regression

Simon Glass sjg at chromium.org
Fri Oct 10 17:26:19 CEST 2014


Hi Marcel,

On 10 October 2014 08:56, Marcel Ziswiler <marcel at ziswiler.com> wrote:
> Fix Tegra GPIO driver to not crash resp. misbehave upon requesting
> GPIOs with an empty aka NULL label. As the driver uses exclusively the
> label to check for reservation status actually supplying one is
> mandatory!
>
> This fixes a regression introduced by commit:
>
> 2fccd2d96badcdf6165658a99771a4c475586279
> tegra: Convert tegra GPIO driver to use driver model
>
> Signed-off-by: Marcel Ziswiler <marcel at ziswiler.com>
> ---
>  drivers/gpio/tegra_gpio.c | 3 +++
>  1 file changed, 3 insertions(+)
>
> diff --git a/drivers/gpio/tegra_gpio.c b/drivers/gpio/tegra_gpio.c
> index 1cc4abb..70663fc 100644
> --- a/drivers/gpio/tegra_gpio.c
> +++ b/drivers/gpio/tegra_gpio.c
> @@ -171,6 +171,9 @@ static int tegra_gpio_request(struct udevice *dev, unsigned offset,
>  {
>         struct tegra_port_info *state = dev_get_priv(dev);
>
> +       if (!label)
> +               return -EINVAL;
> +

Does this patch fix anything? What exactly does it change with your board?

>         if (*state->label[offset])
>                 return -EBUSY;
>
> --
> 1.9.3
>

Regards,
Simon


More information about the U-Boot mailing list