Re: [PATCH] bcache: Fix __bch_btree_node_alloc to make the failure behavior consistent

From: Zheng Hacker
Date: Thu Feb 02 2023 - 21:08:31 EST


Eric Wheeler <bcache@xxxxxxxxxxxxxxxxxx> 于2023年2月3日周五 04:37写道:
>
> On Thu, 2 Feb 2023, Zheng Wang wrote:
>
> > In some specific situation, the return value of __bch_btree_node_alloc may
> > be NULL. This may lead to poential NULL pointer dereference in caller
> > function like a calling chaion :
> > btree_split->bch_btree_node_alloc->__bch_btree_node_alloc.
> >
> > Fix it by initialize return value in __bch_btree_node_alloc before return.
> >
> > Fixes: cafe56359144 ("bcache: A block layer cache")
> > Signed-off-by: Zheng Wang <zyytlz.wz@xxxxxxx>
>
> Be sure to add `Cc: stable@xxxxxxxxxxxxxxx`
>
> -Eric
>

Thanks for your kind reminding. Will do in the next patch.

Best regards,
Zheng Wang