Skip to content
Commit 777967e7 authored by Coly Li's avatar Coly Li Committed by Jens Axboe
Browse files

bcache: check return value from btree_node_alloc_replacement()



In btree_gc_rewrite_node(), pointer 'n' is not checked after it returns
from btree_gc_rewrite_node(). There is potential possibility that 'n' is
a non NULL ERR_PTR(), referencing such error code is not permitted in
following code. Therefore a return value checking is necessary after 'n'
is back from btree_node_alloc_replacement().

Signed-off-by: default avatarColy Li <colyli@suse.de>
Reported-by: default avatarDan Carpenter <dan.carpenter@linaro.org>
Cc:  <stable@vger.kernel.org>
Link: https://lore.kernel.org/r/20231120052503.6122-3-colyli@suse.de


Signed-off-by: default avatarJens Axboe <axboe@kernel.dk>
parent baf8fb7e
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment