提交 54195002 编写于 作者: A Alan Stern 提交者: James Bottomley

[SCSI] fix use after potential free in scsi_remove_device

Signed-off-by: NAlan Stern <stern@rowland.harvard.edu>
Signed-off-by: NJames Bottomley <James.Bottomley@SteelEye.com>
上级 b5683557
...@@ -707,9 +707,11 @@ void __scsi_remove_device(struct scsi_device *sdev) ...@@ -707,9 +707,11 @@ void __scsi_remove_device(struct scsi_device *sdev)
**/ **/
void scsi_remove_device(struct scsi_device *sdev) void scsi_remove_device(struct scsi_device *sdev)
{ {
down(&sdev->host->scan_mutex); struct Scsi_Host *shost = sdev->host;
down(&shost->scan_mutex);
__scsi_remove_device(sdev); __scsi_remove_device(sdev);
up(&sdev->host->scan_mutex); up(&shost->scan_mutex);
} }
EXPORT_SYMBOL(scsi_remove_device); EXPORT_SYMBOL(scsi_remove_device);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册