Commit 5fbcf76
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 <[email protected]>
Link: https://lore.kernel.org/linux-raid/[email protected]
Singed-off-by: Yu Kuai <[email protected]>1 parent 4b10a3b commit 5fbcf76
1 file changed
+7
-1
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
45 | 45 | | |
46 | 46 | | |
47 | 47 | | |
| 48 | + | |
48 | 49 | | |
49 | 50 | | |
50 | 51 | | |
| |||
3258 | 3259 | | |
3259 | 3260 | | |
3260 | 3261 | | |
3261 | | - | |
| 3262 | + | |
| 3263 | + | |
| 3264 | + | |
3262 | 3265 | | |
| 3266 | + | |
3263 | 3267 | | |
3264 | 3268 | | |
3265 | 3269 | | |
| |||
3273 | 3277 | | |
3274 | 3278 | | |
3275 | 3279 | | |
| 3280 | + | |
| 3281 | + | |
3276 | 3282 | | |
3277 | 3283 | | |
3278 | 3284 | | |
| |||
0 commit comments