summaryrefslogtreecommitdiffstats
path: root/drivers/gpio
diff options
context:
space:
mode:
authorTodd Poynor2011-07-18 16:43:14 +0200
committerKevin Hilman2011-08-23 19:53:00 +0200
commit832337490f22987a1b739ba840e105c0c9af01bc (patch)
treea893d220f2d568a0628c77c04d1b9c9899474f87 /drivers/gpio
parentgpio/omap: replace MOD_REG_BIT macro with static inline (diff)
downloadkernel-qcow2-linux-832337490f22987a1b739ba840e105c0c9af01bc.tar.gz
kernel-qcow2-linux-832337490f22987a1b739ba840e105c0c9af01bc.tar.xz
kernel-qcow2-linux-832337490f22987a1b739ba840e105c0c9af01bc.zip
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. */