Re: [PATCH next] btrfs: selftests: prevent error pointer dereference in merge_tests()
From: David Sterba
Date: Fri Dec 06 2024 - 14:37:08 EST
On Fri, Dec 06, 2024 at 03:26:14PM +0300, Dan Carpenter wrote:
> Passing an error pointer to btrfs_unselect_ref_head() will cause an
> Oops so change the error checking from a NULL check to a
> !IS_ERR_OR_NULL(head) check.
>
> The error pointer comes from btrfs_select_ref_head(). If we
> successfully select the head, then we have to unselect it. The select
> function is called six times and five of them change the error pointers
> to NULL, but one call was accidentally missed.
>
> Fixes: fa3dda44871b ("btrfs: selftests: add delayed ref self test cases")
> Signed-off-by: Dan Carpenter <dan.carpenter@xxxxxxxxxx>
Thanks, as the fixed patch is still in the development queue I've folded
it there.