linux-block.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [bug report] blk-mq-sched: add framework for MQ capable IO schedulers
@ 2017-01-19  7:32 Dan Carpenter
  2017-01-19 14:11 ` Jens Axboe
  0 siblings, 1 reply; 2+ messages in thread
From: Dan Carpenter @ 2017-01-19  7:32 UTC (permalink / raw)
  To: axboe; +Cc: linux-block

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

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: [bug report] blk-mq-sched: add framework for MQ capable IO schedulers
  2017-01-19  7:32 [bug report] blk-mq-sched: add framework for MQ capable IO schedulers Dan Carpenter
@ 2017-01-19 14:11 ` Jens Axboe
  0 siblings, 0 replies; 2+ messages in thread
From: Jens Axboe @ 2017-01-19 14:11 UTC (permalink / raw)
  To: Dan Carpenter; +Cc: linux-block

On 01/18/2017 11:32 PM, Dan Carpenter wrote:
> 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				}

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

-- 
Jens Axboe


^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2017-01-19 14:12 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-01-19  7:32 [bug report] blk-mq-sched: add framework for MQ capable IO schedulers Dan Carpenter
2017-01-19 14:11 ` Jens Axboe

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).