diff options
author | Takeshi Yoshimura <yos@sslab.ics.keio.ac.jp> | 2015-06-14 07:55:18 -0400 |
---|---|---|
committer | Sebastian Reichel <sre@kernel.org> | 2015-06-15 06:30:32 -0400 |
commit | 85a5965e1dc5473fd2ae5ff0cb071cfc597c3451 (patch) | |
tree | 284ea1d8fc16662a4e7e81e597f2e7649748d3af /drivers/power | |
parent | 3d7f1800af0e4a781195770644fc1297217ba71d (diff) |
wm831x_power: Fix off-by-one at free_irq()
An error handling in wm831x_power_probe() mistakenly frees a failed-to-
request irq as well as other irqs. I added missing decrement of the loop
counter.
Signed-off-by: Takeshi Yoshimura <yos@sslab.ics.keio.ac.jp>
Acked-by: Charles Keepax <ckeepax@opensource.wolfsonmicro.com>
Signed-off-by: Sebastian Reichel <sre@kernel.org>
Diffstat (limited to 'drivers/power')
-rw-r--r-- | drivers/power/wm831x_power.c | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/drivers/power/wm831x_power.c b/drivers/power/wm831x_power.c index 0161bdabd5a3..db11ae6599f3 100644 --- a/drivers/power/wm831x_power.c +++ b/drivers/power/wm831x_power.c | |||
@@ -609,6 +609,7 @@ static int wm831x_power_probe(struct platform_device *pdev) | |||
609 | return ret; | 609 | return ret; |
610 | 610 | ||
611 | err_bat_irq: | 611 | err_bat_irq: |
612 | --i; | ||
612 | for (; i >= 0; i--) { | 613 | for (; i >= 0; i--) { |
613 | irq = platform_get_irq_byname(pdev, wm831x_bat_irqs[i]); | 614 | irq = platform_get_irq_byname(pdev, wm831x_bat_irqs[i]); |
614 | free_irq(irq, power); | 615 | free_irq(irq, power); |