From: Dan Carpenter Date: Wed, 4 Aug 2010 16:27:45 +0000 (+0000) Subject: 9p: potential ERR_PTR() dereference X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=8f587df479c3cea14ba1a9b9d58f34fd2fd6d58b;p=GitHub%2Fmoto-9609%2Fandroid_kernel_motorola_exynos9610.git 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 Signed-off-by: Eric Van Hensbergen --- diff --git a/fs/9p/fid.c b/fs/9p/fid.c index 358563689064..6406f896bf95 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;