summaryrefslogtreecommitdiff
path: root/drivers
diff options
context:
space:
mode:
authorMarcel Ziswiler <marcel@ziswiler.com>2014-10-10 16:56:50 +0200
committerTom Warren <twarren@nvidia.com>2014-10-22 09:30:55 -0700
commit1c1786d4c5790892c9349cc761cb410a1852526b (patch)
tree709335f183e4cee63368c18fba6ad20ebfbccdb0 /drivers
parent09fb73611ff8c247f7196a8e4f957d8696930b69 (diff)
downloadu-boot-imx-1c1786d4c5790892c9349cc761cb410a1852526b.zip
u-boot-imx-1c1786d4c5790892c9349cc761cb410a1852526b.tar.gz
u-boot-imx-1c1786d4c5790892c9349cc761cb410a1852526b.tar.bz2
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 <marcel@ziswiler.com> Acked-by: Simon Glass <sjg@chromium.org> Signed-off-by: Tom Warren <twarren@nvidia.com>
Diffstat (limited to 'drivers')
-rw-r--r--drivers/gpio/tegra_gpio.c3
1 files changed, 3 insertions, 0 deletions
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;