summaryrefslogtreecommitdiff
path: root/include/linux
diff options
context:
space:
mode:
authorZilin Guan <zilin@seu.edu.cn>2026-01-26 07:15:33 +0000
committerYu Kuai <yukuai@fnnas.com>2026-02-02 15:35:03 +0800
commit6abc7d5dcf0ee0f85e16e41c87fbd06231f28753 (patch)
tree9e4b0f821c876a1e7167f0f8af0c55ebf6c9c650 /include/linux
parent5314d25afbc44d0449fa2519d2c9d7f3c319f74c (diff)
md/raid1: fix memory leak in raid1_run()
raid1_run() calls setup_conf() which registers a thread via md_register_thread(). If raid1_set_limits() fails, the previously registered thread is not unregistered, resulting in a memory leak of the md_thread structure and the thread resource itself. Add md_unregister_thread() to the error path to properly cleanup the thread, which aligns with the error handling logic of other paths in this function. Compile tested only. Issue found using a prototype static analysis tool and code review. Link: https://lore.kernel.org/linux-raid/20260126071533.606263-1-zilin@seu.edu.cn Fixes: 97894f7d3c29 ("md/raid1: use the atomic queue limit update APIs") Signed-off-by: Zilin Guan <zilin@seu.edu.cn> Reviewed-by: Li Nan <linan122@huawei.com> Signed-off-by: Yu Kuai <yukuai@fnnas.com>
Diffstat (limited to 'include/linux')
0 files changed, 0 insertions, 0 deletions