iscsi-scst: Fix a use-after-free (merge r8056 from trunk)

git-svn-id: http://svn.code.sf.net/p/scst/svn/branches/3.3.x@8058 d57e44dd-8a1f-0410-8b47-8ef2f437770f
This commit is contained in:
Bart Van Assche
2019-03-18 01:01:42 +00:00
parent 9c6ebdf779
commit 25163da641

View File

@@ -1426,7 +1426,8 @@ retry:
#if defined(CONFIG_TCP_ZERO_COPY_TRANSFER_COMPLETION_NOTIFICATION)
sock_sendpage = sock->ops->sendpage;
#else
if ((write_cmnd->parent_req->scst_cmd != NULL) &&
if (write_cmnd->parent_req->scst_cmd &&
write_cmnd->parent_req->scst_state != ISCSI_CMD_STATE_AEN &&
scst_cmd_get_dh_data_buff_alloced(write_cmnd->parent_req->scst_cmd))
sock_sendpage = sock_no_sendpage;
else