提交 7435b32e 编写于 作者: M Michael Cyr 提交者: Martin K. Petersen

scsi: ibmvscsis: Clean up properly if target_submit_cmd/tmr fails

Signed-off-by: NMichael Cyr <mikecyr@us.ibm.com>
Signed-off-by: NBryant G. Ly <bryantly@linux.vnet.ibm.com>
Tested-by: NSteven Royer <seroyer@linux.vnet.ibm.com>
Signed-off-by: NMartin K. Petersen <martin.petersen@oracle.com>
上级 8bf11557
......@@ -2560,6 +2560,10 @@ static void ibmvscsis_parse_cmd(struct scsi_info *vscsi,
data_len, attr, dir, 0);
if (rc) {
dev_err(&vscsi->dev, "target_submit_cmd failed, rc %d\n", rc);
spin_lock_bh(&vscsi->intr_lock);
list_del(&cmd->list);
ibmvscsis_free_cmd_resources(vscsi, cmd);
spin_unlock_bh(&vscsi->intr_lock);
goto fail;
}
return;
......@@ -2639,6 +2643,9 @@ static void ibmvscsis_parse_task(struct scsi_info *vscsi,
if (rc) {
dev_err(&vscsi->dev, "target_submit_tmr failed, rc %d\n",
rc);
spin_lock_bh(&vscsi->intr_lock);
list_del(&cmd->list);
spin_unlock_bh(&vscsi->intr_lock);
cmd->se_cmd.se_tmr_req->response =
TMR_FUNCTION_REJECTED;
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册