From: Dan Carpenter Date: Wed, 21 Apr 2010 10:30:32 +0000 (+0200) Subject: fs/sysv: dereferencing ERR_PTR() X-Git-Tag: v2.6.34~6^2~1 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=404e781249f003a37a140756fc4aeae463dcb217;p=profile%2Fcommon%2Fkernel-common.git fs/sysv: dereferencing ERR_PTR() I moved the dir_put_page() inside the if condition so we don't dereference "page", if it's an ERR_PTR(). Signed-off-by: Dan Carpenter Signed-off-by: Al Viro --- diff --git a/fs/sysv/dir.c b/fs/sysv/dir.c index 4e50286..1dabed2 100644 --- a/fs/sysv/dir.c +++ b/fs/sysv/dir.c @@ -164,8 +164,8 @@ struct sysv_dir_entry *sysv_find_entry(struct dentry *dentry, struct page **res_ name, de->name)) goto found; } + dir_put_page(page); } - dir_put_page(page); if (++n >= npages) n = 0;