Commit de9f00d
committed
md/raid1: fix memory leak in raid1_run() if no active rdev
JIRA: https://issues.redhat.com/browse/RHEL-83988
commit 5fbcf76
Author: Zheng Qixing <zhengqixing@huawei.com>
Date: Sat Feb 15 10:01:37 2025 +0800
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: 799af94 ("md/raid1: don't free conf on raid0_run failure")
Signed-off-by: Zheng Qixing <zhengqixing@huawei.com>
Link: https://lore.kernel.org/linux-raid/20250215020137.3703757-1-zhengqixing@huaweicloud.com
Singed-off-by: Yu Kuai <yukuai3@huawei.com>
Signed-off-by: Nigel Croxon <ncroxon@redhat.com>1 parent 2eaeac5 commit de9f00d
1 file changed
+7
-1
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
46 | 46 | | |
47 | 47 | | |
48 | 48 | | |
| 49 | + | |
49 | 50 | | |
50 | 51 | | |
51 | 52 | | |
| |||
3252 | 3253 | | |
3253 | 3254 | | |
3254 | 3255 | | |
3255 | | - | |
| 3256 | + | |
| 3257 | + | |
| 3258 | + | |
3256 | 3259 | | |
| 3260 | + | |
3257 | 3261 | | |
3258 | 3262 | | |
3259 | 3263 | | |
| |||
3267 | 3271 | | |
3268 | 3272 | | |
3269 | 3273 | | |
| 3274 | + | |
| 3275 | + | |
3270 | 3276 | | |
3271 | 3277 | | |
3272 | 3278 | | |
| |||
0 commit comments