md: bcache: check the return value of kzalloc() in detached_dev_do_request()
authorJia-Ju Bai <baijiaju1990@gmail.com>
Fri, 27 May 2022 15:28:18 +0000 (23:28 +0800)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 9 Jun 2022 08:23:32 +0000 (10:23 +0200)
commit2027647245ef44d6a86dc2a2220457e2fc8d3349
tree6288784d198025fab8e7ffb0d8fdecc1e1e181df
parent36a2fc44c574a59ee3b5e2cb327182f227b2b07e
md: bcache: check the return value of kzalloc() in detached_dev_do_request()

commit 40f567bbb3b0639d2ec7d1c6ad4b1b018f80cf19 upstream.

The function kzalloc() in detached_dev_do_request() can fail, so its
return value should be checked.

Fixes: bc082a55d25c ("bcache: fix inaccurate io state for detached bcache devices")
Reported-by: TOTE Robot <oslab@tsinghua.edu.cn>
Signed-off-by: Jia-Ju Bai <baijiaju1990@gmail.com>
Signed-off-by: Coly Li <colyli@suse.de>
Link: https://lore.kernel.org/r/20220527152818.27545-4-colyli@suse.de
Signed-off-by: Jens Axboe <axboe@kernel.dk>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/md/bcache/request.c