Commit 3241d56e authored by Axel Lin's avatar Axel Lin Committed by Greg Kroah-Hartman

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: default avatarAxel Lin <axel.lin@gmail.com>
Acked-by: default avatarMyungJoo Ham <myungjoo.ham@samsung.com>
Acked-by: default avatarArnd Bergmann <arnd@arndb.de>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent e816b57a
......@@ -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;
}
}
......@@ -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:
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment