elevator: fix unnecessary put of elevator in failure case

We already checked that e is NULL, so no point in calling
elevator_put() to free it.

Reported-by: Dan Carpenter <dan.carpenter@oracle.com>
Fixes: dc877dbd088f ("blk-mq-sched: add framework for MQ capable IO schedulers")
Signed-off-by: Jens Axboe <axboe@fb.com>
This commit is contained in:
Jens Axboe 2017-01-19 07:10:13 -07:00
parent 38dbb7dd4d
commit 610d886c0c
1 changed files with 0 additions and 4 deletions

View File

@ -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);
}
}