Commit 3215ffe1 authored by Patrick Mochel's avatar Patrick Mochel

deadline iosched: make sure queue is valid before unregistering it.

- Fixes oops on boot when freeing initrd in 2.5.58.
parent bcd8a0e8
......@@ -431,10 +431,12 @@ int elv_register_queue(struct gendisk *disk)
void elv_unregister_queue(struct gendisk *disk)
{
request_queue_t *q = disk->queue;
elevator_t *e = &q->elevator;
kobject_unregister(&e->kobj);
kobject_put(&disk->kobj);
if (q) {
elevator_t * e = &q->elevator;
kobject_unregister(&e->kobj);
kobject_put(&disk->kobj);
}
}
elevator_t elevator_noop = {
......
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