hostfs: Freeing an ERR_PTR in hostfs_fill_sb_common()
commit8a545f1851upstream. We can't pass error pointers to kfree() or it causes an oops. Fixes:52b209f7b8('get rid of hostfs_read_inode()') Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com> Signed-off-by: Richard Weinberger <richard@nod.at> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
This commit is contained in:
committed by
Greg Kroah-Hartman
parent
69b10e10f5
commit
7b251d3404
@@ -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)) {
|
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)
|
||||||
goto out_put;
|
goto out_put;
|
||||||
|
|||||||
Reference in New Issue
Block a user