linux-input.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Dmitry Torokhov <dmitry.torokhov@gmail.com>
To: Dan Carpenter <dan.carpenter@oracle.com>
Cc: Jingoo Han <jg1.han@samsung.com>,
	Fugang Duan <B38611@freescale.com>,
	Johan Hovold <johan@kernel.org>, Bryan Wu <cooloney@gmail.com>,
	linux-input@vger.kernel.org, kernel-janitors@vger.kernel.org
Subject: Re: [patch] Input: lm8323 - missing error check in lm8323_set_disable()
Date: Tue, 2 Dec 2014 21:56:15 -0800	[thread overview]
Message-ID: <20141203055615.GC7411@dtor-glaptop> (raw)
In-Reply-To: <20141202211710.GA19955@mwanda>

On Wed, Dec 03, 2014 at 12:17:10AM +0300, Dan Carpenter wrote:
> The missing error handling here is not especially harmful but static
> checkers complain that "i" can be used uninitialized.
> 
> Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>

Applied, thank you.

> 
> diff --git a/drivers/input/keyboard/lm8323.c b/drivers/input/keyboard/lm8323.c
> index cb32e2b..21bea52 100644
> --- a/drivers/input/keyboard/lm8323.c
> +++ b/drivers/input/keyboard/lm8323.c
> @@ -616,6 +616,8 @@ static ssize_t lm8323_set_disable(struct device *dev,
>  	unsigned int i;
>  
>  	ret = kstrtouint(buf, 10, &i);
> +	if (ret)
> +		return ret;
>  
>  	mutex_lock(&lm->lock);
>  	lm->kp_enabled = !i;

-- 
Dmitry

      reply	other threads:[~2014-12-03  5:56 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-12-02 21:17 [patch] Input: lm8323 - missing error check in lm8323_set_disable() Dan Carpenter
2014-12-03  5:56 ` Dmitry Torokhov [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=20141203055615.GC7411@dtor-glaptop \
    --to=dmitry.torokhov@gmail.com \
    --cc=B38611@freescale.com \
    --cc=cooloney@gmail.com \
    --cc=dan.carpenter@oracle.com \
    --cc=jg1.han@samsung.com \
    --cc=johan@kernel.org \
    --cc=kernel-janitors@vger.kernel.org \
    --cc=linux-input@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;
as well as URLs for NNTP newsgroup(s).