Skip to content

Commit

Permalink
9p: potential ERR_PTR() dereference
Browse files Browse the repository at this point in the history
p9_client_walk() can return error values if we run out of space or there
is a problem with the network.

Signed-off-by: Dan Carpenter <error27@gmail.com>
Signed-off-by: Eric Van Hensbergen <ericvh@gmail.com>
  • Loading branch information
Dan Carpenter authored and Eric Van Hensbergen committed Aug 30, 2010
1 parent 2bfc96a commit 8f587df
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion fs/9p/fid.c
Original file line number Diff line number Diff line change
Expand Up @@ -242,7 +242,8 @@ struct p9_fid *v9fs_fid_lookup(struct dentry *dentry)
}
kfree(wnames);
fid_out:
v9fs_fid_add(dentry, fid);
if (!IS_ERR(fid))
v9fs_fid_add(dentry, fid);
err_out:
up_read(&v9ses->rename_sem);
return fid;
Expand Down

0 comments on commit 8f587df

Please sign in to comment.