Commit 8f587df4 authored by Dan Carpenter's avatar Dan Carpenter Committed by Eric Van Hensbergen

9p: potential ERR_PTR() dereference

p9_client_walk() can return error values if we run out of space or there
is a problem with the network.
Signed-off-by: default avatarDan Carpenter <error27@gmail.com>
Signed-off-by: default avatarEric Van Hensbergen <ericvh@gmail.com>
parent 2bfc96a1
...@@ -242,7 +242,8 @@ struct p9_fid *v9fs_fid_lookup(struct dentry *dentry) ...@@ -242,7 +242,8 @@ struct p9_fid *v9fs_fid_lookup(struct dentry *dentry)
} }
kfree(wnames); kfree(wnames);
fid_out: fid_out:
v9fs_fid_add(dentry, fid); if (!IS_ERR(fid))
v9fs_fid_add(dentry, fid);
err_out: err_out:
up_read(&v9ses->rename_sem); up_read(&v9ses->rename_sem);
return fid; return fid;
......
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