From: Gustavo A. R. Silva Date: Tue, 13 Jun 2017 16:37:18 +0000 (-0500) Subject: nfc: nci: remove unnecessary null check X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=03036184e9d4a5b2b42a70b66db9455808dd5da9;p=GitHub%2Fmoto-9609%2Fandroid_kernel_motorola_exynos9610.git nfc: nci: remove unnecessary null check Remove unnecessary NULL check for pointer conn_info. conn_info is set in list_for_each_entry() using container_of(), which is never NULL. Addresses-Coverity-ID: 1362349 Reviewed-by: Guenter Roeck Signed-off-by: Gustavo A. R. Silva Signed-off-by: Samuel Ortiz --- diff --git a/net/nfc/nci/core.c b/net/nfc/nci/core.c index 9ec8d8736378..c25e9b4179c3 100644 --- a/net/nfc/nci/core.c +++ b/net/nfc/nci/core.c @@ -73,11 +73,10 @@ 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; } }