From: Takeshi Yoshimura Date: Sun, 14 Jun 2015 11:55:18 +0000 (+0900) Subject: wm831x_power: Fix off-by-one at free_irq() X-Git-Tag: firefly_0821_release~176^2~1602^2~1 X-Git-Url: http://demsky.eecs.uci.edu/git/?a=commitdiff_plain;h=85a5965e1dc5473fd2ae5ff0cb071cfc597c3451;p=firefly-linux-kernel-4.4.55.git 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 Acked-by: Charles Keepax Signed-off-by: Sebastian Reichel --- 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) return ret; err_bat_irq: + --i; for (; i >= 0; i--) { irq = platform_get_irq_byname(pdev, wm831x_bat_irqs[i]); free_irq(irq, power);