diff options
author | Li Zefan <lizf@cn.fujitsu.com> | 2008-07-30 09:24:37 -0400 |
---|---|---|
committer | Chris Mason <chris.mason@oracle.com> | 2008-09-25 11:04:05 -0400 |
commit | 3bf10418675cb424724b5cb9d7725b234defe1fd (patch) | |
tree | da427247ddd1dec91b4c617757bddd926abca997 /fs/btrfs/async-thread.c | |
parent | ab78c84de1ce4db1b2a2cef361625ad80abbab3f (diff) | |
download | blackbird-op-linux-3bf10418675cb424724b5cb9d7725b234defe1fd.tar.gz blackbird-op-linux-3bf10418675cb424724b5cb9d7725b234defe1fd.zip |
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/async-thread.c')
-rw-r--r-- | fs/btrfs/async-thread.c | 1 |
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; } |