Commit 5fbcf76e authored by Zheng Qixing's avatar Zheng Qixing Committed by Yu Kuai
Browse files

md/raid1: fix memory leak in raid1_run() if no active rdev



When `raid1_set_limits()` fails or when the array has no active
`rdev`, the allocated memory for `conf` is not properly freed.

Add raid1_free() call to properly free the conf in error path.

Fixes: 799af947 ("md/raid1: don't free conf on raid0_run failure")
Signed-off-by: default avatarZheng Qixing <zhengqixing@huawei.com>
Link: https://lore.kernel.org/linux-raid/20250215020137.3703757-1-zhengqixing@huaweicloud.com


Singed-off-by: default avatarYu Kuai <yukuai3@huawei.com>
parent 4b10a3bc
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment