From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752154AbcDOPaC (ORCPT ); Fri, 15 Apr 2016 11:30:02 -0400 Received: from bombadil.infradead.org ([198.137.202.9]:48599 "EHLO bombadil.infradead.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751304AbcDOPaA (ORCPT ); Fri, 15 Apr 2016 11:30:00 -0400 Date: Fri, 15 Apr 2016 08:29:59 -0700 From: Darren Hart To: Dan Carpenter Cc: Eric Piel , platform-driver-x86@vger.kernel.org, linux-kernel@vger.kernel.org, kernel-janitors@vger.kernel.org Subject: Re: [patch] hp_accel: Silence an uninitialized variable warning Message-ID: <20160415152959.GC16654@f23x64.localdomain> References: <20160415144720.GF8953@mwanda> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20160415144720.GF8953@mwanda> User-Agent: Mutt/1.5.24 (2015-08-30) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, Apr 15, 2016 at 05:47:20PM +0300, Dan Carpenter wrote: > If acpi_evaluate_integer() fails then "lret" isn't initialized. I've > tweaked the error handling to avoid this issue. > > Signed-off-by: Dan Carpenter Thanks Dan, I verified and queued all 3 patches to fixes for 4.6. > > diff --git a/drivers/platform/x86/hp_accel.c b/drivers/platform/x86/hp_accel.c > index 10ce6cb..746918e 100644 > --- a/drivers/platform/x86/hp_accel.c > +++ b/drivers/platform/x86/hp_accel.c > @@ -127,8 +127,10 @@ static int lis3lv02d_acpi_read(struct lis3lv02d *lis3, int reg, u8 *ret) > arg0.integer.value = reg; > > status = acpi_evaluate_integer(dev->handle, "ALRD", &args, &lret); > + if (ACPI_FAILURE(status)) > + return -EINVAL; > *ret = lret; > - return (status != AE_OK) ? -EINVAL : 0; > + return 0; > } > > /** > -- Darren Hart Intel Open Source Technology Center