Commit 02bf0749 authored by Vasiliy Kulikov's avatar Vasiliy Kulikov Committed by Samuel Ortiz

gpio: Fix stmpe error path

Free allocated memory.  Call stmpe_disable() if it was enabled.
Signed-off-by: default avatarVasiliy Kulikov <segooon@gmail.com>
Acked-by: default avatarWolfram Sang <w.sang@pengutronix.de>
Acked-by: default avatarRabin Vincent <rabin.vincent@stericsson.com>
Signed-off-by: default avatarSamuel Ortiz <sameo@linux.intel.com>
parent 1819ebcf
......@@ -315,11 +315,11 @@ static int __devinit stmpe_gpio_probe(struct platform_device *pdev)
ret = stmpe_enable(stmpe, STMPE_BLOCK_GPIO);
if (ret)
return ret;
goto out_free;
ret = stmpe_gpio_irq_init(stmpe_gpio);
if (ret)
goto out_free;
goto out_disable;
ret = request_threaded_irq(irq, NULL, stmpe_gpio_irq, IRQF_ONESHOT,
"stmpe-gpio", stmpe_gpio);
......@@ -345,6 +345,8 @@ static int __devinit stmpe_gpio_probe(struct platform_device *pdev)
free_irq(irq, stmpe_gpio);
out_removeirq:
stmpe_gpio_irq_remove(stmpe_gpio);
out_disable:
stmpe_disable(stmpe, STMPE_BLOCK_GPIO);
out_free:
kfree(stmpe_gpio);
return ret;
......
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