Commit 1e61a8cd authored by Yu Kuai's avatar Yu Kuai Committed by sanglipeng
Browse files

md/raid10: fix memleak of md thread

stable inclusion
from stable-v5.10.180
commit 2a65555f7e0f4a05b663879908a991e6d9f81e51
category: bugfix
bugzilla: https://gitee.com/openeuler/kernel/issues/I8DDFN

Reference: https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/commit/?id=2a65555f7e0f4a05b663879908a991e6d9f81e51



--------------------------------

[ Upstream commit f0ddb83d ]

In raid10_run(), if setup_conf() succeed and raid10_run() failed before
setting 'mddev->thread', then in the error path 'conf->thread' is not
freed.

Fix the problem by setting 'mddev->thread' right after setup_conf().

Fixes: 43a52123 ("md-cluster: choose correct label when clustered layout is not supported")
Signed-off-by: default avatarYu Kuai <yukuai3@huawei.com>
Signed-off-by: default avatarSong Liu <song@kernel.org>
Link: https://lore.kernel.org/r/20230310073855.1337560-7-yukuai1@huaweicloud.com


Signed-off-by: default avatarSasha Levin <sashal@kernel.org>
Signed-off-by: default avatarsanglipeng <sanglipeng1@jd.com>
parent 22993ed9
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment