public inbox for kernel-janitors@vger.kernel.org
 help / color / mirror / Atom feed
From: Darren Hart <dvhart@infradead.org>
To: Dan Carpenter <dan.carpenter@oracle.com>
Cc: Eric Piel <eric.piel@tremplin-utc.net>,
	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
Date: Fri, 15 Apr 2016 15:29:59 +0000	[thread overview]
Message-ID: <20160415152959.GC16654@f23x64.localdomain> (raw)
In-Reply-To: <20160415144720.GF8953@mwanda>

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 <dan.carpenter@oracle.com>

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

      reply	other threads:[~2016-04-15 15:29 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-04-15 14:47 [patch] hp_accel: Silence an uninitialized variable warning Dan Carpenter
2016-04-15 15:29 ` Darren Hart [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20160415152959.GC16654@f23x64.localdomain \
    --to=dvhart@infradead.org \
    --cc=dan.carpenter@oracle.com \
    --cc=eric.piel@tremplin-utc.net \
    --cc=kernel-janitors@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=platform-driver-x86@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox