cfq_get_queue: fix possible NULL pointer access
PATCH 1/1 cfq_get_queue: fix possible NULL pointer access
cfq_get_queue()->cfq_find_alloc_queue() can fail, check the returned value.
Signed-off-by Oleg Nesterov <[email protected]>
block/cfq-iosched.c renamed from block/cfq-iosched.c~3_get +4 -1
@@ -1443,8 +1443,11 @@ cfq_get_queue(struct cfq_data *cfqd, int 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
Jens Axboe
AppliedQuoted 1 line · Oleg Nesterov
cfq_get_queue()->cfq_find_alloc_queue() can fail, check the returned value.
Thanks, applied! No normal IO paths use it without __GFP_WAIT, so it's not a critical fix. But that could change in the future and then cause allocation failure, so I'll add the patch.
Signature · 1 line
Jens Axboe