summaryrefslogtreecommitdiff
path: root/drivers/gpio
diff options
context:
space:
mode:
authorTodd Poynor <toddpoynor@google.com>2011-07-18 18:43:14 +0400
committerKevin Hilman <khilman@ti.com>2011-08-23 21:53:00 +0400
commit832337490f22987a1b739ba840e105c0c9af01bc (patch)
treea893d220f2d568a0628c77c04d1b9c9899474f87 /drivers/gpio
parentece9528e5f88cee11303fceefe39382f1030cd4e (diff)
downloadlinux-832337490f22987a1b739ba840e105c0c9af01bc.tar.xz
gpio/omap: check return value from irq_alloc_generic_chip
Ensure return value of irq_alloc_generic_chip() is checked before continuing on to use it. Signed-off-by: Todd Poynor <toddpoynor@google.com> Signed-off-by: Kevin Hilman <khilman@ti.com>
Diffstat (limited to 'drivers/gpio')
-rw-r--r--drivers/gpio/gpio-omap.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/drivers/gpio/gpio-omap.c b/drivers/gpio/gpio-omap.c
index 34a7110d9bc8..f0208a958185 100644
--- a/drivers/gpio/gpio-omap.c
+++ b/drivers/gpio/gpio-omap.c
@@ -1090,6 +1090,11 @@ omap_mpuio_alloc_gc(struct gpio_bank *bank, unsigned int irq_start,
gc = irq_alloc_generic_chip("MPUIO", 1, irq_start, bank->base,
handle_simple_irq);
+ if (!gc) {
+ dev_err(bank->dev, "Memory alloc failed for gc\n");
+ return;
+ }
+
ct = gc->chip_types;
/* NOTE: No ack required, reading IRQ status clears it. */