mirror of
https://github.com/adulau/aha.git
synced 2024-12-29 04:06:22 +00:00
Btrfs: async-thread: fix possible memory leak
When kthread_run() returns failure, this worker hasn't been added to the list, so btrfs_stop_workers() won't free it. Signed-off-by: Li Zefan <lizf@cn.fujitsu.com> Signed-off-by: Chris Mason <chris.mason@oracle.com>
This commit is contained in:
parent
ab78c84de1
commit
3bf1041867
1 changed files with 1 additions and 0 deletions
|
@ -187,6 +187,7 @@ int btrfs_start_workers(struct btrfs_workers *workers, int num_workers)
|
|||
worker->task = kthread_run(worker_loop, worker, "btrfs");
|
||||
worker->workers = workers;
|
||||
if (IS_ERR(worker->task)) {
|
||||
kfree(worker);
|
||||
ret = PTR_ERR(worker->task);
|
||||
goto fail;
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue