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>
This commit is contained in:
Jiri Slaby 2009-07-02 13:50:58 -04:00 коммит произвёл Chris Mason
Родитель 9427216476
Коммит 9b627e9bf4
1 изменённых файлов: 1 добавлений и 1 удалений

Просмотреть файл

@ -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;
}