linux-wireless.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] NFC: nci: Remove an unneeded NULL check
@ 2017-06-14  7:49 Dan Carpenter
  2017-06-22 22:47 ` Samuel Ortiz
  0 siblings, 1 reply; 2+ messages in thread
From: Dan Carpenter @ 2017-06-14  7:49 UTC (permalink / raw)
  To: Samuel Ortiz, Christophe Ricard; +Cc: linux-wireless, kernel-janitors

"conn_info" can't be NULL here.  Also we just dereferenced it a couple
lines earlier, so that makes static checkers complain.

Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>

diff --git a/net/nfc/nci/core.c b/net/nfc/nci/core.c
index 61fff422424f..5542fc72f020 100644
--- a/net/nfc/nci/core.c
+++ b/net/nfc/nci/core.c
@@ -73,11 +73,9 @@ int nci_get_conn_info_by_dest_type_params(struct nci_dev *ndev, u8 dest_type,
 		if (conn_info->dest_type == dest_type) {
 			if (!params)
 				return conn_info->conn_id;
-			if (conn_info) {
-				if (params->id == conn_info->dest_params->id &&
-				    params->protocol == conn_info->dest_params->protocol)
-					return conn_info->conn_id;
-			}
+			if (params->id == conn_info->dest_params->id &&
+			    params->protocol == conn_info->dest_params->protocol)
+				return conn_info->conn_id;
 		}
 	}
 

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

end of thread, other threads:[~2017-06-22 22:48 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-06-14  7:49 [PATCH] NFC: nci: Remove an unneeded NULL check Dan Carpenter
2017-06-22 22:47 ` Samuel Ortiz

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