Skip to content

Commit

Permalink
Btrfs: fix use after free in btrfs_start_workers fail path
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Jiri Slaby authored and Chris Mason committed Jul 2, 2009
1 parent 9427216 commit 9b627e9
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion fs/btrfs/async-thread.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}

Expand Down

0 comments on commit 9b627e9

Please sign in to comment.