提交 0a0836a0 编写于 作者: O Oleg Nesterov 提交者: Jens Axboe

cfq_get_queue: fix possible NULL pointer access

cfq_get_queue()->cfq_find_alloc_queue() can fail, check the returned value.
Signed-off-by: NOleg Nesterov <oleg@tv-sign.ru>

Note that this isn't a bug at the moment, since the regular IO path
does not call this path without __GFP_WAIT set. However, it could be a
future bug, so I've applied it.
Signed-off-by: NJens Axboe <jens.axboe@oracle.com>
上级 abbeb88d
......@@ -1443,8 +1443,11 @@ cfq_get_queue(struct cfq_data *cfqd, int is_sync, struct task_struct *tsk,
cfqq = *async_cfqq;
}
if (!cfqq)
if (!cfqq) {
cfqq = cfq_find_alloc_queue(cfqd, is_sync, tsk, gfp_mask);
if (!cfqq)
return NULL;
}
/*
* pin the queue now that it's allocated, scheduler exit will prune it
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册