Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > linux.kernel > #1345014
| From | Colin King <colin.king@canonical.com> |
|---|---|
| Newsgroups | linux.kernel |
| Subject | [PATCH] power_supply: lp8788-charger: initialize boolean 'found' |
| Date | 2016-02-27 14:00 +0100 |
| Message-ID | <r6MDv-343-5@gated-at.bofh.it> (permalink) |
| Organization | linux.* mail to news gateway |
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
Back to linux.kernel | Previous | Next — Next in thread | Find similar | Unroll thread
[PATCH] power_supply: lp8788-charger: initialize boolean 'found' Colin King <colin.king@canonical.com> - 2016-02-27 14:00 +0100 Re: [PATCH] power_supply: lp8788-charger: initialize boolean 'found' "Kim, Milo" <milo.kim@ti.com> - 2016-02-29 00:30 +0100 Re: [PATCH] power_supply: lp8788-charger: initialize boolean 'found' Sebastian Reichel <sre@kernel.org> - 2016-03-03 15:30 +0100
csiph-web