]> git.karo-electronics.de Git - karo-tx-linux.git/commit
SCSI: Avoid dangling pointer in scsi_requeue_command()
authorBart Van Assche <bvanassche@acm.org>
Fri, 29 Jun 2012 15:34:26 +0000 (15:34 +0000)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 9 Aug 2012 15:27:34 +0000 (08:27 -0700)
commit8add44b313360a3940e6734b96c636c8c8edc5f8
tree21c4fcf0cfe7a86881f9560ac46305b4a76b5d2e
parent8fff2f802f32cbb0ed253117cc01586762c22ae9
SCSI: Avoid dangling pointer in scsi_requeue_command()

commit 940f5d47e2f2e1fa00443921a0abf4822335b54d upstream.

When we call scsi_unprep_request() the command associated with the request
gets destroyed and therefore drops its reference on the device.  If this was
the only reference, the device may get released and we end up with a NULL
pointer deref when we call blk_requeue_request.

Reported-by: Mike Christie <michaelc@cs.wisc.edu>
Signed-off-by: Bart Van Assche <bvanassche@acm.org>
Reviewed-by: Mike Christie <michaelc@cs.wisc.edu>
Reviewed-by: Tejun Heo <tj@kernel.org>
[jejb: enhance commend and add commit log for stable]
Signed-off-by: James Bottomley <JBottomley@Parallels.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/scsi/scsi_lib.c