diff options
author | Axel Lin <axel.lin@gmail.com> | 2012-03-25 21:57:08 -0400 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2012-04-18 17:52:40 -0400 |
commit | 3241d56edda5cae37cc91b8031d6b52ed69d7eab (patch) | |
tree | 1c19fe6a09cc641035d69d5b6104f78079faa3c1 /drivers/misc | |
parent | e816b57a337ea3b755de72bec38c10c864f23015 (diff) |
misc: Fix irq leak in max8997_muic_probe error path
Current code does not properly free allocated irqs if request_threaded_irq
returns error, fix it.
Signed-off-by: Axel Lin <axel.lin@gmail.com>
Acked-by: MyungJoo Ham <myungjoo.ham@samsung.com>
Acked-by: Arnd Bergmann <arnd@arndb.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/misc')
-rw-r--r-- | drivers/misc/max8997-muic.c | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/drivers/misc/max8997-muic.c b/drivers/misc/max8997-muic.c index 19591eaa492a..2e7df9c56491 100644 --- a/drivers/misc/max8997-muic.c +++ b/drivers/misc/max8997-muic.c | |||
@@ -440,10 +440,6 @@ static int __devinit max8997_muic_probe(struct platform_device *pdev) | |||
440 | "failed: irq request (IRQ: %d," | 440 | "failed: irq request (IRQ: %d," |
441 | " error :%d)\n", | 441 | " error :%d)\n", |
442 | muic_irq->irq, ret); | 442 | muic_irq->irq, ret); |
443 | |||
444 | for (i = i - 1; i >= 0; i--) | ||
445 | free_irq(muic_irq->irq, info); | ||
446 | |||
447 | goto err_irq; | 443 | goto err_irq; |
448 | } | 444 | } |
449 | } | 445 | } |
@@ -457,6 +453,8 @@ static int __devinit max8997_muic_probe(struct platform_device *pdev) | |||
457 | return ret; | 453 | return ret; |
458 | 454 | ||
459 | err_irq: | 455 | err_irq: |
456 | while (--i >= 0) | ||
457 | free_irq(pdata->irq_base + muic_irqs[i].irq, info); | ||
460 | err_pdata: | 458 | err_pdata: |
461 | kfree(info); | 459 | kfree(info); |
462 | err_kfree: | 460 | err_kfree: |