Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1355681 > unrolled thread

[patch] mfd: lp8788-irq: uninitialized variable in irq handler

Started byDan Carpenter <dan.carpenter@oracle.com>
First post2016-03-11 09:20 +0100
Last post2016-03-14 00:20 +0100
Articles 2 — 2 participants

Back to article view | Back to linux.kernel


Contents

  [patch] mfd: lp8788-irq: uninitialized variable in irq handler Dan Carpenter <dan.carpenter@oracle.com> - 2016-03-11 09:20 +0100
    Re: [patch] mfd: lp8788-irq: uninitialized variable in irq handler "Kim, Milo" <milo.kim@ti.com> - 2016-03-14 00:20 +0100

#1355681 — [patch] mfd: lp8788-irq: uninitialized variable in irq handler

FromDan Carpenter <dan.carpenter@oracle.com>
Date2016-03-11 09:20 +0100
Subject[patch] mfd: lp8788-irq: uninitialized variable in irq handler
Message-ID<rbqsF-3iZ-5@gated-at.bofh.it>
Instead to being true/false, the "handled" is true/uninitialized.
Presumably this doesn't cause that many problems in real life because
normally we handle the IRQ.

Fixes: eea6b7cc53aa ('mfd: Add lp8788 mfd driver')
Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>

diff --git a/drivers/mfd/lp8788-irq.c b/drivers/mfd/lp8788-irq.c
index c7a9825..792d51b 100644
--- a/drivers/mfd/lp8788-irq.c
+++ b/drivers/mfd/lp8788-irq.c
@@ -112,7 +112,7 @@ static irqreturn_t lp8788_irq_handler(int irq, void *ptr)
 	struct lp8788_irq_data *irqd = ptr;
 	struct lp8788 *lp = irqd->lp;
 	u8 status[NUM_REGS], addr, mask;
-	bool handled;
+	bool handled = false;
 	int i;
 
 	if (lp8788_read_multi_bytes(lp, LP8788_INT_1, status, NUM_REGS))

[toc] | [next] | [standalone]


#1356773

From"Kim, Milo" <milo.kim@ti.com>
Date2016-03-14 00:20 +0100
Message-ID<rcnsK-3RH-1@gated-at.bofh.it>
In reply to#1355681
On 3/11/2016 5:11 PM, Dan Carpenter wrote:
> Instead to being true/false, the "handled" is true/uninitialized.
> Presumably this doesn't cause that many problems in real life because
> normally we handle the IRQ.
>
> Fixes: eea6b7cc53aa ('mfd: Add lp8788 mfd driver')
> Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>

Acked-by: Milo Kim <milo.kim@ti.com>

Thanks for catching this!

>
> diff --git a/drivers/mfd/lp8788-irq.c b/drivers/mfd/lp8788-irq.c
> index c7a9825..792d51b 100644
> --- a/drivers/mfd/lp8788-irq.c
> +++ b/drivers/mfd/lp8788-irq.c
> @@ -112,7 +112,7 @@ static irqreturn_t lp8788_irq_handler(int irq, void *ptr)
>   	struct lp8788_irq_data *irqd = ptr;
>   	struct lp8788 *lp = irqd->lp;
>   	u8 status[NUM_REGS], addr, mask;
> -	bool handled;
> +	bool handled = false;
>   	int i;
>
>   	if (lp8788_read_multi_bytes(lp, LP8788_INT_1, status, NUM_REGS))
>

[toc] | [prev] | [standalone]


Back to top | Article view | linux.kernel


csiph-web