mirror of
https://github.com/SCST-project/scst.git
synced 2026-08-19 13:46:25 +00:00
isert: fix double free of a fake request
A nop that is sent from the scst is treated as a fake request. When a fake request is allocated we release it immediately, so it's wrong to release it also on a completion error (isert_pdu_err). This commit fix a NULL dereference bug when receiving completion with error on this nop. Signed-off-by: Israel Rukshin <israelr@mellanox.com> Signed-off-by: Ariel Nahum <arieln@mellanox.com> git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@6876 d57e44dd-8a1f-0410-8b47-8ef2f437770f
This commit is contained in:
@@ -637,7 +637,7 @@ static void isert_handle_wc_error(struct ib_wc *wc)
|
||||
#endif
|
||||
if (unlikely(num_sge == 0)) /* Drain WR */
|
||||
isert_sched_conn_drained(isert_conn);
|
||||
else
|
||||
else if (!isert_pdu->is_fake_rx)
|
||||
isert_pdu_err(&isert_pdu->iscsi);
|
||||
break;
|
||||
case ISER_WR_RDMA_READ:
|
||||
@@ -646,7 +646,8 @@ static void isert_handle_wc_error(struct ib_wc *wc)
|
||||
isert_buf->dma_dir);
|
||||
isert_buf->sg_cnt = 0;
|
||||
}
|
||||
isert_pdu_err(&isert_pdu->iscsi);
|
||||
if (!isert_pdu->is_fake_rx)
|
||||
isert_pdu_err(&isert_pdu->iscsi);
|
||||
break;
|
||||
case ISER_WR_RECV:
|
||||
/* this should be the Flush, no task has been created yet */
|
||||
|
||||
Reference in New Issue
Block a user