Skip to content

Commit

Permalink
misc: Fix irq leak in max8997_muic_probe error path
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Axel Lin authored and Greg Kroah-Hartman committed Apr 18, 2012
1 parent e816b57 commit 3241d56
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions drivers/misc/max8997-muic.c
Original file line number Diff line number Diff line change
Expand Up @@ -440,10 +440,6 @@ static int __devinit max8997_muic_probe(struct platform_device *pdev)
"failed: irq request (IRQ: %d,"
" error :%d)\n",
muic_irq->irq, ret);

for (i = i - 1; i >= 0; i--)
free_irq(muic_irq->irq, info);

goto err_irq;
}
}
Expand All @@ -457,6 +453,8 @@ static int __devinit max8997_muic_probe(struct platform_device *pdev)
return ret;

err_irq:
while (--i >= 0)
free_irq(pdata->irq_base + muic_irqs[i].irq, info);
err_pdata:
kfree(info);
err_kfree:
Expand Down

0 comments on commit 3241d56

Please sign in to comment.