2015-06-14 11:58:39

by Takeshi Yoshimura

[permalink] [raw]
Subject: [PATCH 1/1] 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 <[email protected]>
---
drivers/power/wm831x_power.c | 1 +
1 file changed, 1 insertion(+)

diff --git a/drivers/power/wm831x_power.c b/drivers/power/wm831x_power.c
index 0161bda..db11ae6 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);
--
1.9.1


2015-06-14 13:24:46

by Charles Keepax

[permalink] [raw]
Subject: Re: [PATCH 1/1] wm831x_power: Fix off-by-one at free_irq()

On Sun, Jun 14, 2015 at 08:55:18PM +0900, Takeshi Yoshimura wrote:
> 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 <[email protected]>
> ---

Acked-by: Charles Keepax <[email protected]>

Thanks,
Charles

2015-06-15 10:32:51

by Sebastian Reichel

[permalink] [raw]
Subject: Re: [PATCH 1/1] wm831x_power: Fix off-by-one at free_irq()

Hi,

On Sun, Jun 14, 2015 at 08:55:18PM +0900, Takeshi Yoshimura wrote:
> 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.

Thanks, applied.

-- Sebastian


Attachments:
(No filename) (264.00 B)
signature.asc (819.00 B)
Digital signature
Download all attachments