aboutsummaryrefslogtreecommitdiffstats
path: root/block
diff options
context:
space:
mode:
Diffstat (limited to 'block')
-rw-r--r--block/elevator.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/block/elevator.c b/block/elevator.c
index bc7baeec0d10..9b72dc7c8a5c 100644
--- a/block/elevator.c
+++ b/block/elevator.c
@@ -765,7 +765,8 @@ void elv_unregister(struct elevator_type *e)
765 read_lock(&tasklist_lock); 765 read_lock(&tasklist_lock);
766 do_each_thread(g, p) { 766 do_each_thread(g, p) {
767 task_lock(p); 767 task_lock(p);
768 e->ops.trim(p->io_context); 768 if (p->io_context)
769 e->ops.trim(p->io_context);
769 task_unlock(p); 770 task_unlock(p);
770 } while_each_thread(g, p); 771 } while_each_thread(g, p);
771 read_unlock(&tasklist_lock); 772 read_unlock(&tasklist_lock);