提交 9b627e9b 编写于 作者: J Jiri Slaby 提交者: Chris Mason

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: NJiri Slaby <jirislaby@gmail.com>
Signed-off-by: NChris Mason <chris.mason@oracle.com>
上级 94272164
......@@ -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;
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册