]> www.infradead.org Git - users/dwmw2/linux.git/commit
block, bfq: handle NULL return value by bfq_init_rq()
authorPaolo Valente <paolo.valente@linaro.org>
Wed, 7 Aug 2019 17:21:11 +0000 (19:21 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 29 Aug 2019 06:30:18 +0000 (08:30 +0200)
commit371879acb44ece108ad1efbbbbf61fc75a08eee9
tree001566fe542ba2e0efb4fdd4684615a19b4876d3
parent6bfd59d9913325b96f9db14e60fc328e81c656e7
block, bfq: handle NULL return value by bfq_init_rq()

[ Upstream commit fd03177c33b287c6541f4048f1d67b7b45a1abc9 ]

As reported in [1], the call bfq_init_rq(rq) may return NULL in case
of OOM (in particular, if rq->elv.icq is NULL because memory
allocation failed in failed in ioc_create_icq()).

This commit handles this circumstance.

[1] https://lkml.org/lkml/2019/7/22/824

Cc: Hsin-Yi Wang <hsinyi@google.com>
Cc: Nicolas Boichat <drinkcat@chromium.org>
Cc: Doug Anderson <dianders@chromium.org>
Reported-by: Guenter Roeck <linux@roeck-us.net>
Reported-by: Hsin-Yi Wang <hsinyi@google.com>
Reviewed-by: Guenter Roeck <linux@roeck-us.net>
Signed-off-by: Paolo Valente <paolo.valente@linaro.org>
Signed-off-by: Jens Axboe <axboe@kernel.dk>
Signed-off-by: Sasha Levin <sashal@kernel.org>
block/bfq-iosched.c