All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] input: synaptics-rmi4: remove redundant null check on rmi_dev
@ 2016-12-21 14:41 Colin King
  2016-12-29 18:20 ` Dmitry Torokhov
  0 siblings, 1 reply; 2+ messages in thread
From: Colin King @ 2016-12-21 14:41 UTC (permalink / raw)
  To: Dmitry Torokhov, Andrew Duggan, Benjamin Tissoires, Lyude Paul,
	Dennis Wassenberg, linux-input
  Cc: linux-kernel

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

^ permalink raw reply related	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2016-12-29 18:20 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-12-21 14:41 [PATCH] input: synaptics-rmi4: remove redundant null check on rmi_dev Colin King
2016-12-29 18:20 ` Dmitry Torokhov

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.