Re: [PATCH] md/raid5: setup_conf: Fix null-ptr-def in error handling path

From: yu kuai

Date: Thu Sep 17 2026 - 02:50:02 EST


在 2026/9/15 16:17, Zhihao Cheng 写道:

> For raid5 setup_conf, if an error(eg. bioset_init fails) happens before
> 'conf->mddev = mddev', following error handling path could trigger a
> null-ptr-def problem:
>
> free_conf
> log_exit
> raid5_has_ppl
> test_bit(MD_HAS_PPL, &conf->mddev->flags) // conf->mddev is NULL !
>
> Fix it by initializing conf->mddev in advance.
>
> Fixes: 3418d036c81d ("raid5-ppl: Partial Parity Log write logging implementation")
> Signed-off-by: Zhihao Cheng<chengzhihao1@xxxxxxxxxx>
> ---
> drivers/md/raid5.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
Applied to md-7.4

--
Thanks,
Kuai