diff options
author | Ding Hui <dinghui@sangfor.com.cn> | 2021-09-11 16:51:59 +0300 |
---|---|---|
committer | Martin K. Petersen <martin.petersen@oracle.com> | 2021-09-14 07:02:45 +0300 |
commit | e018f03d6ccbd9c3ce6a9fae4f582113f2a2906b (patch) | |
tree | 49becf93f5fd2e83ba3ff3297c6419136e508a71 /drivers/scsi/libiscsi.c | |
parent | ce4fc333e599c19973455c9d8f6fbb1e7c140dc8 (diff) | |
download | linux-e018f03d6ccbd9c3ce6a9fae4f582113f2a2906b.tar.xz |
scsi: libiscsi: Move ehwait initialization to iscsi_session_setup()
Commit ec29d0ac29be ("scsi: iscsi: Fix conn use after free during resets")
moved member ehwait from 'conn' to 'session', but left the initialization
of ehwait in iscsi_conn_setup().
Although a session can only have 1 conn currently, it is better to
initialize ehwait in iscsi_session_setup() in case we implement handling
multiple conns in the future.
Link: https://lore.kernel.org/r/20210911135159.20543-1-dinghui@sangfor.com.cn
Reviewed-by: Mike Christie <michael.christie@oracle.com>
Signed-off-by: Ding Hui <dinghui@sangfor.com.cn>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
Diffstat (limited to 'drivers/scsi/libiscsi.c')
-rw-r--r-- | drivers/scsi/libiscsi.c | 3 |
1 files changed, 1 insertions, 2 deletions
diff --git a/drivers/scsi/libiscsi.c b/drivers/scsi/libiscsi.c index 4683c183e9d4..712a45368385 100644 --- a/drivers/scsi/libiscsi.c +++ b/drivers/scsi/libiscsi.c @@ -2947,6 +2947,7 @@ iscsi_session_setup(struct iscsi_transport *iscsit, struct Scsi_Host *shost, session->tmf_state = TMF_INITIAL; timer_setup(&session->tmf_timer, iscsi_tmf_timedout, 0); mutex_init(&session->eh_mutex); + init_waitqueue_head(&session->ehwait); spin_lock_init(&session->frwd_lock); spin_lock_init(&session->back_lock); @@ -3074,8 +3075,6 @@ iscsi_conn_setup(struct iscsi_cls_session *cls_session, int dd_size, goto login_task_data_alloc_fail; conn->login_task->data = conn->data = data; - init_waitqueue_head(&session->ehwait); - return cls_conn; login_task_data_alloc_fail: |