diff options
author | Baruch Siach <baruch@tkos.co.il> | 2009-06-30 22:41:38 +0400 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2009-07-01 05:56:01 +0400 |
commit | 79d7f4ee23d41571d9e4663521b5e6604c55729a (patch) | |
tree | be5c6b2c817c1d14a7b3da42c8c09671aa132752 /drivers/gpio/pl061.c | |
parent | 66918dcdf91ad101194c749c18099e836ba3de2b (diff) | |
download | linux-79d7f4ee23d41571d9e4663521b5e6604c55729a.tar.xz |
gpio: pl061: fix probe error handling code
Note that IRQ has not been initialized when kmalloc() fails.
Also, use DECLARE_BITMAP() to make the code clearer.
Signed-off-by: Baruch Siach <baruch@tkos.co.il>
Cc: David Brownell <david-b@pacbell.net>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'drivers/gpio/pl061.c')
-rw-r--r-- | drivers/gpio/pl061.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/drivers/gpio/pl061.c b/drivers/gpio/pl061.c index aa8e7cb020d9..80e483986699 100644 --- a/drivers/gpio/pl061.c +++ b/drivers/gpio/pl061.c @@ -221,7 +221,7 @@ static int __init pl061_probe(struct amba_device *dev, struct amba_id *id) struct pl061_gpio *chip; struct list_head *chip_list; int ret, irq, i; - static unsigned long init_irq[BITS_TO_LONGS(NR_IRQS)]; + static DECLARE_BITMAP(init_irq, NR_IRQS); pdata = dev->dev.platform_data; if (pdata == NULL) @@ -280,6 +280,7 @@ static int __init pl061_probe(struct amba_device *dev, struct amba_id *id) if (!test_and_set_bit(irq, init_irq)) { /* list initialized? */ chip_list = kmalloc(sizeof(*chip_list), GFP_KERNEL); if (chip_list == NULL) { + clear_bit(irq, init_irq); ret = -ENOMEM; goto iounmap; } |