From: Marcel Ziswiler Date: Fri, 10 Oct 2014 14:56:50 +0000 (+0200) Subject: tegra: gpio: fix null label regression X-Git-Tag: v2015.01-rc1~178^2~7 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=1c1786d4c5790892c9349cc761cb410a1852526b;p=platform%2Fkernel%2Fu-boot.git tegra: gpio: fix null label regression 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 Acked-by: Simon Glass Signed-off-by: Tom Warren --- 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; + if (*state->label[offset]) return -EBUSY;