aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDan Carpenter <error27@gmail.com>2010-08-04 16:27:45 +0000
committerEric Van Hensbergen <ericvh@gmail.com>2010-08-30 10:35:28 -0500
commit8f587df479c3cea14ba1a9b9d58f34fd2fd6d58b (patch)
tree5c01cd8b1fa9ecea9af268890d39a49b017a8631
parent2bfc96a127bc1cc94d26bfaa40159966064f9c8c (diff)
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: Dan Carpenter <error27@gmail.com> Signed-off-by: Eric Van Hensbergen <ericvh@gmail.com>
-rw-r--r--fs/9p/fid.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/fs/9p/fid.c b/fs/9p/fid.c
index 35856368906..6406f896bf9 100644
--- a/fs/9p/fid.c
+++ b/fs/9p/fid.c
@@ -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;