Skip to content

Commit

Permalink
[SCSI] fix use after potential free in scsi_remove_device
Browse files Browse the repository at this point in the history
Signed-off-by: Alan Stern <stern@rowland.harvard.edu>
Signed-off-by: James Bottomley <James.Bottomley@SteelEye.com>
  • Loading branch information
Alan Stern authored and James Bottomley committed Sep 16, 2005
1 parent b568355 commit 5419500
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions drivers/scsi/scsi_sysfs.c
Original file line number Diff line number Diff line change
Expand Up @@ -707,9 +707,11 @@ 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);
up(&sdev->host->scan_mutex);
up(&shost->scan_mutex);
}
EXPORT_SYMBOL(scsi_remove_device);

Expand Down

0 comments on commit 5419500

Please sign in to comment.