From patchwork Fri Jul 3 07:59:14 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Maninder Singh X-Patchwork-Id: 6713331 Return-Path: X-Original-To: patchwork-linux-scsi@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork1.web.kernel.org (Postfix) with ESMTP id 1744B9F380 for ; Fri, 3 Jul 2015 08:00:17 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 1D4A32077D for ; Fri, 3 Jul 2015 08:00:16 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id BF8D82077C for ; Fri, 3 Jul 2015 08:00:14 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754508AbbGCIAO (ORCPT ); Fri, 3 Jul 2015 04:00:14 -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 Received: from epcpsbgr2.samsung.com (u142.gpu120.samsung.co.kr [203.254.230.142]) by mailout4.samsung.com (Oracle Communications Messaging Server 7.0.5.31.0 64bit (built May 5 2014)) with ESMTP id <0NQW01JD5JKAR240@mailout4.samsung.com>; Fri, 03 Jul 2015 17:00:10 +0900 (KST) Received: from epcpsbgm2.samsung.com ( [172.20.52.123]) by epcpsbgr2.samsung.com (EPCPMTA) with SMTP id A2.BC.28411.A0146955; Fri, 3 Jul 2015 17:00:10 +0900 (KST) X-AuditID: cbfee68e-f79c56d000006efb-d8-5596410ace7e Received: from epmmp2 ( [203.254.227.17]) by epcpsbgm2.samsung.com (EPCPMTA) with SMTP id 5C.EA.05312.A0146955; Fri, 3 Jul 2015 17:00:10 +0900 (KST) Received: from localhost.localdomain ([107.108.92.210]) by mmp2.samsung.com (Oracle Communications Messaging Server 7.0.5.31.0 64bit (built May 5 2014)) with ESMTPA id <0NQW001JNJJ0NAC0@mmp2.samsung.com>; Fri, 03 Jul 2015 17:00:10 +0900 (KST) 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 dbPvl57cROH5Qnp2Yt94p84tPPLy6BlT8+dS8Xb87Msr8l4+vyz0Kn6SkMaKnSyq53y+mCnu mlfiWPDNLSly+6pexturxZYyPvlkumtGQPJCBbEZgsauL+X++wctzZwz71nXogeNgZMLl9ZK FM2e/O7lvqnJ0ksYi/mUWIozEg21mIuKEwG4563+SQIAAA== X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFmpgkeLIzCtJLcpLzFFi42I5/e+xoC6X47RQg6UHuC3+r7/NYnF51xw2 i+7rO9gsDs9vY7G492Yrk8WvBekObB6Hf/xg9lj35QS7R9+WVYwenzfJBbBENTDaZKQmpqQW KaTmJeenZOal2yp5B8c7x5uaGRjqGlpamCsp5CXmptoqufgE6Lpl5gAtV1IoS8wpBQoFJBYX K+nbYZoQGuKmawHTGKHrGxIE12NkgAYS1jBmfD39nrngKEfFkp/BDYyT2LsYOTkkBEwkvmxt hrLFJC7cW8/WxcjFISQwnVFiycZ97BDOT0aJs2s/sYFUsQnoSazatYcFxBYRKJe48uApUJyD g1nASWL6Vz2QsLCAhcT5+Z1MIDaLgKrE5Yv7wVp5Bdwlpi0+ygxSLiGgIDFnks0ERu4FjAyr GEVTC5ILipPSc430ihNzi0vz0vWS83M3MYJD/5n0DsZVDRaHGAU4GJV4eC+cnhoqxJpYVlyZ e4hRgoNZSYT3qMq0UCHelMTKqtSi/Pii0pzU4kOMpkDLJzJLiSbnA+MyryTe0NjE3NTY1NLE wsTMUkmc92S+T6iQQHpiSWp2ampBahFMHxMHp1QD42aW7ppv7+Z9UP/HvIRrZuSlxrjq9VW2 4ps8D18QXHWqxLRxmmCZ1cr4xX2VO1xvyv6dLWQ5e8HqAxdXyr6Jb3y0mkfmsLGQ8q4zD6++ tjuyeousnNATsw+vb1ZvOW9ueqHv5XK3M2Z9sopSklEe0QfdGRimq1y+t9xP8L82m4vUKhNx boE34kosxRmJhlrMRcWJAMO6L7aTAgAA DLP-Filter: Pass X-MTR: 20000000000000000@CPGS X-CFilter-Loop: Reflected Sender: linux-scsi-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-scsi@vger.kernel.org X-Spam-Status: No, score=-7.5 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_HI, RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP 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;