linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Colin King <colin.king@canonical.com>
To: Dmitry Torokhov <dmitry.torokhov@gmail.com>,
	Andrew Duggan <aduggan@synaptics.com>,
	Benjamin Tissoires <benjamin.tissoires@redhat.com>,
	Lyude Paul <thatslyude@gmail.com>,
	Dennis Wassenberg <dennis.wassenberg@secunet.com>,
	linux-input@vger.kernel.org
Cc: linux-kernel@vger.kernel.org
Subject: [PATCH] input: synaptics-rmi4: remove redundant null check on rmi_dev
Date: Wed, 21 Dec 2016 14:41:04 +0000	[thread overview]
Message-ID: <20161221144104.25794-1-colin.king@canonical.com> (raw)

From: Colin Ian King <colin.king@canonical.com>

rmi_dev is currently being dereferenced before it null checked,
however, after deeper inspecting, rmi_dev can never be null,
so just remove this redundant check. Thanks to Dmitry Torokhov for
noticing that we can remove the null check.

Fixes CoverityScan CID 1391218 ("Dereference before null check")

Signed-off-by: Colin Ian King <colin.king@canonical.com>
---
 drivers/input/rmi4/rmi_f03.c | 3 ---
 1 file changed, 3 deletions(-)

diff --git a/drivers/input/rmi4/rmi_f03.c b/drivers/input/rmi4/rmi_f03.c
index 8a7ca3e..9a1b099 100644
--- a/drivers/input/rmi4/rmi_f03.c
+++ b/drivers/input/rmi4/rmi_f03.c
@@ -175,9 +175,6 @@ static int rmi_f03_attention(struct rmi_function *fn, unsigned long *irq_bits)
 	int i;
 	int error;
 
-	if (!rmi_dev)
-		return -ENODEV;
-
 	if (drvdata->attn_data.data) {
 		/* First grab the data passed by the transport device */
 		if (drvdata->attn_data.size < ob_len) {
-- 
2.10.2

             reply	other threads:[~2016-12-21 14:41 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-12-21 14:41 Colin King [this message]
2016-12-29 18:20 ` 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=20161221144104.25794-1-colin.king@canonical.com \
    --to=colin.king@canonical.com \
    --cc=aduggan@synaptics.com \
    --cc=benjamin.tissoires@redhat.com \
    --cc=dennis.wassenberg@secunet.com \
    --cc=dmitry.torokhov@gmail.com \
    --cc=linux-input@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=thatslyude@gmail.com \
    --subject='Re: [PATCH] input: synaptics-rmi4: remove redundant null check on rmi_dev' \
    /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

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).