summaryrefslogtreecommitdiffstats
path: root/fs/btrfs/async-thread.c
diff options
context:
space:
mode:
authorJiri Slaby <jirislaby@gmail.com>2009-07-02 19:50:58 +0200
committerChris Mason <chris.mason@oracle.com>2009-07-02 19:50:58 +0200
commit9b627e9bf49ebfeb060dfae0435bdba06cf27cb8 (patch)
treecbd6255b5dd72f7b17c08ac5bfab9a95819008ee /fs/btrfs/async-thread.c
parentBtrfs: honor nodatacow/sum mount options for new files (diff)
downloadlinux-9b627e9bf49ebfeb060dfae0435bdba06cf27cb8.tar.xz
linux-9b627e9bf49ebfeb060dfae0435bdba06cf27cb8.zip
Btrfs: fix use after free in btrfs_start_workers fail path
worker memory is already freed on one fail path in btrfs_start_workers, but is still dereferenced. Switch the dereference and kfree. Signed-off-by: Jiri Slaby <jirislaby@gmail.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.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/fs/btrfs/async-thread.c b/fs/btrfs/async-thread.c
index 7f88628a1a72..6e4f6c50a120 100644
--- a/fs/btrfs/async-thread.c
+++ b/fs/btrfs/async-thread.c
@@ -299,8 +299,8 @@ int btrfs_start_workers(struct btrfs_workers *workers, int num_workers)
"btrfs-%s-%d", workers->name,
workers->num_workers + i);
if (IS_ERR(worker->task)) {
- kfree(worker);
ret = PTR_ERR(worker->task);
+ kfree(worker);
goto fail;
}