提交 3241d56e 编写于 作者: A Axel Lin 提交者: 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: NAxel Lin <axel.lin@gmail.com>
Acked-by: NMyungJoo Ham <myungjoo.ham@samsung.com>
Acked-by: NArnd Bergmann <arnd@arndb.de>
Signed-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
上级 e816b57a
...@@ -440,10 +440,6 @@ static int __devinit max8997_muic_probe(struct platform_device *pdev) ...@@ -440,10 +440,6 @@ static int __devinit max8997_muic_probe(struct platform_device *pdev)
"failed: irq request (IRQ: %d," "failed: irq request (IRQ: %d,"
" error :%d)\n", " error :%d)\n",
muic_irq->irq, ret); muic_irq->irq, ret);
for (i = i - 1; i >= 0; i--)
free_irq(muic_irq->irq, info);
goto err_irq; goto err_irq;
} }
} }
...@@ -457,6 +453,8 @@ static int __devinit max8997_muic_probe(struct platform_device *pdev) ...@@ -457,6 +453,8 @@ static int __devinit max8997_muic_probe(struct platform_device *pdev)
return ret; return ret;
err_irq: err_irq:
while (--i >= 0)
free_irq(pdata->irq_base + muic_irqs[i].irq, info);
err_pdata: err_pdata:
kfree(info); kfree(info);
err_kfree: err_kfree:
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册