From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755990AbcB1XXH (ORCPT ); Sun, 28 Feb 2016 18:23:07 -0500 Received: from comal.ext.ti.com ([198.47.26.152]:43906 "EHLO comal.ext.ti.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755865AbcB1XXE (ORCPT ); Sun, 28 Feb 2016 18:23:04 -0500 Subject: Re: [PATCH] power_supply: lp8788-charger: initialize boolean 'found' To: Colin King References: <1456577651-5644-1-git-send-email-colin.king@canonical.com> CC: Sebastian Reichel , Dmitry Eremin-Solenikov , David Woodhouse , , From: "Kim, Milo" Message-ID: <56D38134.7030101@ti.com> Date: Mon, 29 Feb 2016 08:22:28 +0900 User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:38.0) Gecko/20100101 Thunderbird/38.1.0 MIME-Version: 1.0 In-Reply-To: <1456577651-5644-1-git-send-email-colin.king@canonical.com> Content-Type: text/plain; charset="windows-1252"; format=flowed Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 2/27/2016 9:54 PM, Colin King wrote: > From: Colin Ian King > > 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 Acked-by: Milo Kim 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++) { >