From: Jens Axboe Date: Thu, 19 Jan 2017 14:10:13 +0000 (-0700) Subject: elevator: fix unnecessary put of elevator in failure case X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=610d886c0c22fa7504e817b6d03c402de64b0264;p=GitHub%2FLineageOS%2Fandroid_kernel_motorola_exynos9610.git 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 Fixes: dc877dbd088f ("blk-mq-sched: add framework for MQ capable IO schedulers") Signed-off-by: Jens Axboe --- diff --git a/block/elevator.c b/block/elevator.c index bcba2dd5cb5c..ef7f59469acc 100644 --- a/block/elevator.c +++ b/block/elevator.c @@ -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); } }