[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: James Bottomley <James.Bottomley@SteelEye.com>

authored by

James Bottomley and committed by
James Bottomley
788ce43a e91442b6

+2 -3
+2 -3
drivers/scsi/scsi_lib.c
··· 1370 1370 { 1371 1371 struct scsi_cmnd *cmd = req->special; 1372 1372 1373 - spin_unlock(q->queue_lock); 1373 + blkdev_dequeue_request(req); 1374 + 1374 1375 if (unlikely(cmd == NULL)) { 1375 1376 printk(KERN_CRIT "impossible request in %s.\n", 1376 1377 __FUNCTION__); ··· 1382 1381 cmd->result = DID_NO_CONNECT << 16; 1383 1382 atomic_inc(&cmd->device->iorequest_cnt); 1384 1383 __scsi_done(cmd); 1385 - spin_lock(q->queue_lock); 1386 1384 } 1387 1385 1388 1386 /* ··· 1432 1432 if (unlikely(!scsi_device_online(sdev))) { 1433 1433 printk(KERN_ERR "scsi%d (%d:%d): rejecting I/O to offline device\n", 1434 1434 sdev->host->host_no, sdev->id, sdev->lun); 1435 - blkdev_dequeue_request(req); 1436 1435 scsi_kill_request(req, q); 1437 1436 continue; 1438 1437 }