* [PATCH] power_supply: lp8788-charger: initialize boolean 'found'
@ 2016-02-27 12:54 Colin King
2016-02-28 23:22 ` Kim, Milo
2016-03-03 14:19 ` Sebastian Reichel
0 siblings, 2 replies; 3+ messages in thread
From: Colin King @ 2016-02-27 12:54 UTC (permalink / raw)
To: Milo Kim, Sebastian Reichel, Dmitry Eremin-Solenikov,
David Woodhouse, linux-pm
Cc: linux-kernel
From: Colin Ian King <colin.king@canonical.com>
The boolean 'found' is not initialized and hence garbage. It should
be initialized as false.
Found with static analysis using CoverityScan
Signed-off-by: Colin Ian King <colin.king@canonical.com>
---
drivers/power/lp8788-charger.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/power/lp8788-charger.c b/drivers/power/lp8788-charger.c
index f5a48fd..7321b72 100644
--- a/drivers/power/lp8788-charger.c
+++ b/drivers/power/lp8788-charger.c
@@ -455,7 +455,7 @@ static void lp8788_charger_event(struct work_struct *work)
static bool lp8788_find_irq_id(struct lp8788_charger *pchg, int virq, int *id)
{
- bool found;
+ bool found = false;
int i;
for (i = 0; i < pchg->num_irqs; i++) {
--
2.7.0
^ permalink raw reply related [flat|nested] 3+ messages in thread* Re: [PATCH] power_supply: lp8788-charger: initialize boolean 'found'
2016-02-27 12:54 [PATCH] power_supply: lp8788-charger: initialize boolean 'found' Colin King
@ 2016-02-28 23:22 ` Kim, Milo
2016-03-03 14:19 ` Sebastian Reichel
1 sibling, 0 replies; 3+ messages in thread
From: Kim, Milo @ 2016-02-28 23:22 UTC (permalink / raw)
To: Colin King
Cc: Sebastian Reichel, Dmitry Eremin-Solenikov, David Woodhouse,
linux-pm, linux-kernel
On 2/27/2016 9:54 PM, Colin King wrote:
> From: Colin Ian King <colin.king@canonical.com>
>
> The boolean 'found' is not initialized and hence garbage. It should
> be initialized as false.
>
> Found with static analysis using CoverityScan
>
> Signed-off-by: Colin Ian King <colin.king@canonical.com>
Acked-by: Milo Kim <milo.kim@ti.com>
Thanks for catching this.
> ---
> drivers/power/lp8788-charger.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/power/lp8788-charger.c b/drivers/power/lp8788-charger.c
> index f5a48fd..7321b72 100644
> --- a/drivers/power/lp8788-charger.c
> +++ b/drivers/power/lp8788-charger.c
> @@ -455,7 +455,7 @@ static void lp8788_charger_event(struct work_struct *work)
>
> static bool lp8788_find_irq_id(struct lp8788_charger *pchg, int virq, int *id)
> {
> - bool found;
> + bool found = false;
> int i;
>
> for (i = 0; i < pchg->num_irqs; i++) {
>
^ permalink raw reply [flat|nested] 3+ messages in thread* Re: [PATCH] power_supply: lp8788-charger: initialize boolean 'found'
2016-02-27 12:54 [PATCH] power_supply: lp8788-charger: initialize boolean 'found' Colin King
2016-02-28 23:22 ` Kim, Milo
@ 2016-03-03 14:19 ` Sebastian Reichel
1 sibling, 0 replies; 3+ messages in thread
From: Sebastian Reichel @ 2016-03-03 14:19 UTC (permalink / raw)
To: Colin King
Cc: Milo Kim, Dmitry Eremin-Solenikov, David Woodhouse, linux-pm,
linux-kernel
[-- Attachment #1: Type: text/plain, Size: 255 bytes --]
Hi,
On Sat, Feb 27, 2016 at 12:54:11PM +0000, Colin King wrote:
> The boolean 'found' is not initialized and hence garbage. It should
> be initialized as false.
>
> Found with static analysis using CoverityScan
Thanks, queued.
-- Sebastian
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 819 bytes --]
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2016-03-03 14:19 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-02-27 12:54 [PATCH] power_supply: lp8788-charger: initialize boolean 'found' Colin King
2016-02-28 23:22 ` Kim, Milo
2016-03-03 14:19 ` Sebastian Reichel
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).