summaryrefslogtreecommitdiff
path: root/fs/btrfs
diff options
context:
space:
mode:
authorLi Zefan <lizf@cn.fujitsu.com>2008-07-30 17:24:37 +0400
committerChris Mason <chris.mason@oracle.com>2008-09-25 19:04:05 +0400
commit3bf10418675cb424724b5cb9d7725b234defe1fd (patch)
treeda427247ddd1dec91b4c617757bddd926abca997 /fs/btrfs
parentab78c84de1ce4db1b2a2cef361625ad80abbab3f (diff)
downloadlinux-3bf10418675cb424724b5cb9d7725b234defe1fd.tar.xz
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>
Diffstat (limited to 'fs/btrfs')
-rw-r--r--fs/btrfs/async-thread.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/fs/btrfs/async-thread.c b/fs/btrfs/async-thread.c
index 8d4cc4679d51..5fe6a0d532ed 100644
--- a/fs/btrfs/async-thread.c
+++ b/fs/btrfs/async-thread.c
@@ -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;
}