lkml.org 
[lkml]   [2015]   [Jul]   [3]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
From
Subject[PATCH 1/1] SCSI: bnx2i: remove redundant check
Date
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 <maninder1.s@samsung.com>
---
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


\
 
 \ /
  Last update: 2015-07-03 10:21    [W:0.025 / U:0.080 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site