Skip to content

Commit

Permalink
elevator: fix unnecessary put of elevator in failure case
Browse files Browse the repository at this point in the history
We already checked that e is NULL, so no point in calling
elevator_put() to free it.

Reported-by: Dan Carpenter <[email protected]>
Fixes: dc877dbd088f ("blk-mq-sched: add framework for MQ capable IO schedulers")
Signed-off-by: Jens Axboe <[email protected]>
  • Loading branch information
axboe committed Jan 19, 2017
1 parent 38dbb7d commit 610d886
Showing 1 changed file with 0 additions and 4 deletions.
4 changes: 0 additions & 4 deletions block/elevator.c
Original file line number Diff line number Diff line change
Expand Up @@ -230,10 +230,6 @@ int elevator_init(struct request_queue *q, char *name)
printk(KERN_ERR
"Default I/O scheduler not found. " \
"Using noop/none.\n");
if (q->mq_ops) {
elevator_put(e);
return 0;
}
e = elevator_get("noop", false);
}
}
Expand Down

0 comments on commit 610d886

Please sign in to comment.