linux-input.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Dan Carpenter <dan.carpenter@oracle.com>
To: Dmitry Torokhov <dmitry.torokhov@gmail.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: [patch] Input: lm8323 - missing error check in lm8323_set_disable()
Date: Wed, 3 Dec 2014 00:17:10 +0300	[thread overview]
Message-ID: <20141202211710.GA19955@mwanda> (raw)

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>

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;

             reply	other threads:[~2014-12-02 21:17 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-12-02 21:17 Dan Carpenter [this message]
2014-12-03  5:56 ` [patch] Input: lm8323 - missing error check in lm8323_set_disable() Dmitry Torokhov

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=20141202211710.GA19955@mwanda \
    --to=dan.carpenter@oracle.com \
    --cc=B38611@freescale.com \
    --cc=cooloney@gmail.com \
    --cc=dmitry.torokhov@gmail.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).