scsi: libiscsi: Fix NULL pointer dereference in iscsi_eh_session_reset
authorFred Herard <fred.herard@oracle.com>
Wed, 21 Nov 2018 01:22:45 +0000 (20:22 -0500)
committerMartin K. Petersen <martin.petersen@oracle.com>
Wed, 28 Nov 2018 23:38:22 +0000 (18:38 -0500)
This commit addresses NULL pointer dereference in iscsi_eh_session_reset.
Reference should not be made to session->leadconn when session->state is
set to ISCSI_STATE_TERMINATE.

Signed-off-by: Fred Herard <fred.herard@oracle.com>
Reviewed-by: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
Reviewed-by: Lee Duncan <lduncan@suse.com>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
drivers/scsi/libiscsi.c

index 93c66ebad907ee0e9b99505e54aed32853ab4aae..f78d2e5c1471d3faf22d8e5a9b98e566f1531189 100644 (file)
@@ -2416,8 +2416,8 @@ int iscsi_eh_session_reset(struct scsi_cmnd *sc)
 failed:
                ISCSI_DBG_EH(session,
                             "failing session reset: Could not log back into "
-                            "%s, %s [age %d]\n", session->targetname,
-                            conn->persistent_address, session->age);
+                            "%s [age %d]\n", session->targetname,
+                            session->age);
                spin_unlock_bh(&session->frwd_lock);
                mutex_unlock(&session->eh_mutex);
                return FAILED;