bnx2i: silence uninitialized variable warnings
authorDan Carpenter <dan.carpenter@oracle.com>
Thu, 14 Apr 2016 09:40:06 +0000 (12:40 +0300)
committerMartin K. Petersen <martin.petersen@oracle.com>
Tue, 26 Apr 2016 02:02:40 +0000 (22:02 -0400)
Presumably it isn't possible to have empty lists here, but my static
checker doesn't know that and complains that "ep" can be used
uninitialized.

Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Acked-by: Nilesh Javali <nilesh.javali@qlogic.com>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
drivers/scsi/bnx2i/bnx2i_iscsi.c

index 72894378ffcf1c911a9b8ee9b55ee0cfc289a4e4..133901fd3e35f2b02194481c3a93f7b9b1097c1c 100644 (file)
@@ -675,7 +675,7 @@ bnx2i_find_ep_in_ofld_list(struct bnx2i_hba *hba, u32 iscsi_cid)
 {
        struct list_head *list;
        struct list_head *tmp;
-       struct bnx2i_endpoint *ep;
+       struct bnx2i_endpoint *ep = NULL;
 
        read_lock_bh(&hba->ep_rdwr_lock);
        list_for_each_safe(list, tmp, &hba->ep_ofld_list) {
@@ -703,7 +703,7 @@ bnx2i_find_ep_in_destroy_list(struct bnx2i_hba *hba, u32 iscsi_cid)
 {
        struct list_head *list;
        struct list_head *tmp;
-       struct bnx2i_endpoint *ep;
+       struct bnx2i_endpoint *ep = NULL;
 
        read_lock_bh(&hba->ep_rdwr_lock);
        list_for_each_safe(list, tmp, &hba->ep_destroy_list) {