diff --git a/drivers/block/elevator.c b/drivers/block/elevator.c index 3b652eba2d206c872e1e1c1b3ac6be1554a3ebd0..36f1057084b024bdc978db18d3b1fab43ecd3273 100644 --- a/drivers/block/elevator.c +++ b/drivers/block/elevator.c @@ -753,8 +753,10 @@ ssize_t elv_iosched_store(request_queue_t *q, const char *name, size_t count) return -EINVAL; } - if (!strcmp(elevator_name, q->elevator->elevator_type->elevator_name)) + if (!strcmp(elevator_name, q->elevator->elevator_type->elevator_name)) { + elevator_put(e); return count; + } elevator_switch(q, e); return count;