提交 8a545f18 编写于 作者: D Dan Carpenter 提交者: Richard Weinberger

hostfs: Freeing an ERR_PTR in hostfs_fill_sb_common()

We can't pass error pointers to kfree() or it causes an oops.

Fixes: 52b209f7 ('get rid of hostfs_read_inode()')
Signed-off-by: NDan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: NRichard Weinberger <richard@nod.at>
上级 915eed20
......@@ -959,10 +959,11 @@ static int hostfs_fill_sb_common(struct super_block *sb, void *d, int silent)
if (S_ISLNK(root_inode->i_mode)) {
char *name = follow_link(host_root_path);
if (IS_ERR(name))
if (IS_ERR(name)) {
err = PTR_ERR(name);
else
err = read_name(root_inode, name);
goto out_put;
}
err = read_name(root_inode, name);
kfree(name);
if (err)
goto out_put;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册