libata: fix NULL sdev dereference race in atapi_qc_complete()
SCSI commands may be issued between __scsi_add_device() and dev->sdev assignment, so it's unsafe for ata_qc_complete() to dereference dev->sdev->locked without checking whether it's NULL or not. Fix it. Signed-off-by: NTejun Heo <tj@kernel.org> Cc: stable@kernel.org Signed-off-by: NJeff Garzik <jgarzik@redhat.com>
Showing
想要评论请 注册 或 登录