diff options
author | Fred Herard <fred.herard@oracle.com> | 2018-11-20 20:22:45 -0500 |
---|---|---|
committer | Martin K. Petersen <martin.petersen@oracle.com> | 2018-11-28 18:38:22 -0500 |
commit | 5db6dd14b31397e8cccaaddab2ff44ebec1acf25 (patch) | |
tree | 819ff1cab97237822f127563ae5e2d60dd83abea | |
parent | dfb7513374c1f8e7cd595106fbdba3fd07ebaf30 (diff) |
scsi: libiscsi: Fix NULL pointer dereference in iscsi_eh_session_reset
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>
-rw-r--r-- | drivers/scsi/libiscsi.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/drivers/scsi/libiscsi.c b/drivers/scsi/libiscsi.c index 93c66ebad907..f78d2e5c1471 100644 --- a/drivers/scsi/libiscsi.c +++ b/drivers/scsi/libiscsi.c | |||
@@ -2416,8 +2416,8 @@ int iscsi_eh_session_reset(struct scsi_cmnd *sc) | |||
2416 | failed: | 2416 | failed: |
2417 | ISCSI_DBG_EH(session, | 2417 | ISCSI_DBG_EH(session, |
2418 | "failing session reset: Could not log back into " | 2418 | "failing session reset: Could not log back into " |
2419 | "%s, %s [age %d]\n", session->targetname, | 2419 | "%s [age %d]\n", session->targetname, |
2420 | conn->persistent_address, session->age); | 2420 | session->age); |
2421 | spin_unlock_bh(&session->frwd_lock); | 2421 | spin_unlock_bh(&session->frwd_lock); |
2422 | mutex_unlock(&session->eh_mutex); | 2422 | mutex_unlock(&session->eh_mutex); |
2423 | return FAILED; | 2423 | return FAILED; |