[SCSI] Avoid dangling pointer in scsi_requeue_command()
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: NMike Christie <michaelc@cs.wisc.edu> Signed-off-by: NBart Van Assche <bvanassche@acm.org> Reviewed-by: NMike Christie <michaelc@cs.wisc.edu> Reviewed-by: NTejun Heo <tj@kernel.org> Cc: <stable@kernel.org> [jejb: enhance commend and add commit log for stable] Signed-off-by: NJames Bottomley <JBottomley@Parallels.com>
Showing
想要评论请 注册 或 登录