Commit 7b251d34 authored by Dan Carpenter's avatar Dan Carpenter Committed by Greg Kroah-Hartman

hostfs: Freeing an ERR_PTR in hostfs_fill_sb_common()

commit 8a545f18 upstream.

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

Fixes: 52b209f7 ('get rid of hostfs_read_inode()')
Signed-off-by: default avatarDan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: default avatarRichard Weinberger <richard@nod.at>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent 69b10e10
...@@ -959,9 +959,10 @@ static int hostfs_fill_sb_common(struct super_block *sb, void *d, int silent) ...@@ -959,9 +959,10 @@ static int hostfs_fill_sb_common(struct super_block *sb, void *d, int silent)
if (S_ISLNK(root_inode->i_mode)) { if (S_ISLNK(root_inode->i_mode)) {
char *name = follow_link(host_root_path); char *name = follow_link(host_root_path);
if (IS_ERR(name)) if (IS_ERR(name)) {
err = PTR_ERR(name); err = PTR_ERR(name);
else goto out_put;
}
err = read_name(root_inode, name); err = read_name(root_inode, name);
kfree(name); kfree(name);
if (err) if (err)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment