Commit ad34a784 authored by James Bottomley's avatar James Bottomley

Fix use after free in scsi_host_put

put_device will call release and free the host structure (which
contains both the generic device and the host class).  We must do
the class_device_put() *before* the put_device().
parent 5751c8d6
...@@ -553,8 +553,8 @@ void scsi_host_get(struct Scsi_Host *shost) ...@@ -553,8 +553,8 @@ void scsi_host_get(struct Scsi_Host *shost)
void scsi_host_put(struct Scsi_Host *shost) void scsi_host_put(struct Scsi_Host *shost)
{ {
put_device(&shost->host_gendev);
class_device_put(&shost->class_dev); class_device_put(&shost->class_dev);
put_device(&shost->host_gendev);
return; return;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment