Commit 788ce43a authored by James Bottomley's avatar James Bottomley Committed by James Bottomley
Browse files

[SCSI] SCSI core: fix leakage of scsi_cmnd's

Actually, just one problem and one cosmetic fix:

1) We need to dequeue for the loop and kill case (it seems easiest
simply to dequeue in the scsi_kill_request() routine)
2) There's no real need to drop the queue lock.  __scsi_done() is lock
agnostic, so since there's no requirement, let's just leave it in to
avoid any locking issues.

Signed-off-by: default avatarJames Bottomley <>
parent e91442b6
......@@ -1370,7 +1370,8 @@ static void scsi_kill_request(struct request *req, request_queue_t *q)
struct scsi_cmnd *cmd = req->special;
if (unlikely(cmd == NULL)) {
printk(KERN_CRIT "impossible request in %s.\n",
......@@ -1381,7 +1382,6 @@ static void scsi_kill_request(struct request *req, request_queue_t *q)
cmd->result = DID_NO_CONNECT << 16;
......@@ -1432,7 +1432,6 @@ static void scsi_request_fn(struct request_queue *q)
if (unlikely(!scsi_device_online(sdev))) {
printk(KERN_ERR "scsi%d (%d:%d): rejecting I/O to offline device\n",
sdev->host->host_no, sdev->id, sdev->lun);
scsi_kill_request(req, q);
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment