Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754713AbbGCIAP (ORCPT ); Fri, 3 Jul 2015 04:00:15 -0400 Received: from mailout4.samsung.com ([203.254.224.34]:52187 "EHLO mailout4.samsung.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754475AbbGCIAM (ORCPT ); Fri, 3 Jul 2015 04:00:12 -0400 X-AuditID: cbfee68e-f79c56d000006efb-d8-5596410ace7e From: Maninder Singh To: QLogic-Storage-Upstream@qlogic.com, JBottomley@odin.com, linux-scsi@vger.kernel.org, linux-kernel@vger.kernel.org Cc: pankaj.m@samsung.com, Maninder Singh Subject: [PATCH 1/1] SCSI: bnx2i: remove redundant check Date: Fri, 03 Jul 2015 13:29:14 +0530 Message-id: <1435910355-30070-1-git-send-email-maninder1.s@samsung.com> X-Mailer: git-send-email 1.7.9.5 X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFtrGLMWRmVeSWpSXmKPExsWyRsSkWpfLcVqoweKNwhb/199msbi8aw6b Rff1HWwWh+e3sVjce7OVyeLXgnQHNo/DP34we6z7coLdo2/LKkaPz5vkAliiuGxSUnMyy1KL 9O0SuDK+nn7PXHCUo2LJz+AGxknsXYycHBICJhIP/l5ihbDFJC7cW8/WxcjFISSwlFHi3fp1 cEVftjazQySmM0os2bgPyvnJKHF27Sc2kCo2AT2JVbv2sIDYIgLlElcePAWKc3AwCzhJTP+q BxIWFrCQOD+/kwnEZhFQlbh8cT9YK6+Au8S0xUeZQcolBBQk5kyyARkvIfCeTeLyvXvsEPUC Et8mH2KBqJGV2HSAGeI2SYmDK26wTGAUXMDIsIpRNLUguaA4Kb3ISK84Mbe4NC9dLzk/dxMj MDhP/3vWt4Px5gHrQ4wCHIxKPLwXTk8NFWJNLCuuzD3EaAq0YSKzlGhyPjAG8kriDY3NjCxM TUyNjcwtzZTEeROkfgYLCaQnlqRmp6YWpBbFF5XmpBYfYmTi4JRqYJxQ5vL9UPjbG9+n+JzZ dbP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Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1307 Lines: 36 Removing static analysis error:- (error) Possible null pointer dereference: hba hba->cid_que.conn_cid_tbl[iscsi_cid] = bnx2i_conn; ^^^^ Validation of hba is not required in if check, because validation is done before entrying to this function and error comes because after this check hba is dereferenced without validation. Signed-off-by: Maninder Singh --- drivers/scsi/bnx2i/bnx2i_iscsi.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/scsi/bnx2i/bnx2i_iscsi.c b/drivers/scsi/bnx2i/bnx2i_iscsi.c index 7289437..cbec2ea 100644 --- a/drivers/scsi/bnx2i/bnx2i_iscsi.c +++ b/drivers/scsi/bnx2i/bnx2i_iscsi.c @@ -239,7 +239,7 @@ static int bnx2i_bind_conn_to_iscsi_cid(struct bnx2i_hba *hba, struct bnx2i_conn *bnx2i_conn, u32 iscsi_cid) { - if (hba && hba->cid_que.conn_cid_tbl[iscsi_cid]) { + if (hba->cid_que.conn_cid_tbl[iscsi_cid]) { iscsi_conn_printk(KERN_ALERT, bnx2i_conn->cls_conn->dd_data, "conn bind - entry #%d not free\n", iscsi_cid); return -EBUSY; -- 1.7.9.5 -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/