X-Git-Url: https://err.no/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=block%2Felevator.c;h=9b72dc7c8a5c98dcde87dc0d7e42d9a56f447776;hb=62250b3bb596ffbae17c4b3d865fecd6329ce8b3;hp=a0afdd317ceffb3d59f230c775da6c03740a426f;hpb=d90d2c385d4d832428d1e51c2a7edeef39c822f5;p=linux-2.6 diff --git a/block/elevator.c b/block/elevator.c index a0afdd317c..9b72dc7c8a 100644 --- a/block/elevator.c +++ b/block/elevator.c @@ -27,7 +27,6 @@ #include #include #include -#include #include #include #include @@ -766,7 +765,8 @@ void elv_unregister(struct elevator_type *e) read_lock(&tasklist_lock); do_each_thread(g, p) { task_lock(p); - e->ops.trim(p->io_context); + if (p->io_context) + e->ops.trim(p->io_context); task_unlock(p); } while_each_thread(g, p); read_unlock(&tasklist_lock); @@ -850,12 +850,9 @@ fail_register: * one again (along with re-adding the sysfs dir) */ elevator_exit(e); - e = NULL; q->elevator = old_elevator; elv_register_queue(q); clear_bit(QUEUE_FLAG_ELVSWITCH, &q->queue_flags); - if (e) - kobject_put(&e->kobj); return 0; }