Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 54195002 authored by Alan Stern's avatar Alan Stern Committed by James Bottomley
Browse files

[SCSI] fix use after potential free in scsi_remove_device

parent b5683557
Loading
Loading
Loading
Loading
+4 −2
Original line number Diff line number Diff line
@@ -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);