Commit 29e9689d authored by Bartlomiej Zolnierkiewicz's avatar Bartlomiej Zolnierkiewicz Committed by Linus Torvalds

[PATCH] fix use-after-free in ide_unregister()

parent c0eeedbb
...@@ -673,8 +673,8 @@ void ide_unregister (unsigned int index) ...@@ -673,8 +673,8 @@ void ide_unregister (unsigned int index)
blk_cleanup_queue(&drive->queue); blk_cleanup_queue(&drive->queue);
} }
if (hwif->next == hwif) { if (hwif->next == hwif) {
kfree(hwgroup);
BUG_ON(hwgroup->hwif != hwif); BUG_ON(hwgroup->hwif != hwif);
kfree(hwgroup);
} else { } else {
/* There is another interface in hwgroup. /* There is another interface in hwgroup.
* Unlink us, and set hwgroup->drive and ->hwif to * Unlink us, and set hwgroup->drive and ->hwif to
......
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