Skip to contentSkip to conversation

blk-mq-sched: add framework for MQ capable IO schedulers

bug report Dan Carpenter 2 participants 2 messages Jan 19, 2017 Block layer

lore
Share & tools
lore
#0 lore raw

Hello Jens Axboe,

This is a semi-automatic email about new static checker warnings.

The patch bd166ef183c2: "blk-mq-sched: add framework for MQ capable IO schedulers" from Jan 17, 2017, leads to the following Smatch complaint:

block/elevator.c:234 elevator_init()
error: we previously assumed 'e' could be null (see line 229)

block/elevator.c
228

   229			if (!e) {
                            ^^

Null.

230 printk(KERN_ERR
231 "Default I/O scheduler not found. " \
232 "Using noop/none.\n");
233 if (q->mq_ops) {

   234					elevator_put(e);
                                        ^^^^^^^^^^^^^^^

This will Oops.

235 return 0;
236 }

regards,
dan carpenter

#1 lore raw
Quoted 23 lines · Dan Carpenter

Hello Jens Axboe,

This is a semi-automatic email about new static checker warnings.

The patch bd166ef183c2: "blk-mq-sched: add framework for MQ capable IO schedulers" from Jan 17, 2017, leads to the following Smatch complaint:

block/elevator.c:234 elevator_init()
error: we previously assumed 'e' could be null (see line 229)

block/elevator.c
228

   229			if (!e) {
                            ^^

Null.

   230				printk(KERN_ERR
   231					"Default I/O scheduler not found. " \
   232					"Using noop/none.\n");
   233				if (q->mq_ops) {
   234					elevator_put(e);
                                        ^^^^^^^^^^^^^^^
Quoted 4 lines

This will Oops.

   235					return 0;
   236				}

Good find, thanks Dan. I've killed the elevator_put().

Signature · 1 line
Jens Axboe