From: Dan Carpenter Date: Wed, 21 Apr 2010 10:30:32 +0000 (+0200) Subject: fs/sysv: dereferencing ERR_PTR() X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=404e781249f003a37a140756fc4aeae463dcb217;p=GitHub%2FLineageOS%2Fandroid_kernel_samsung_universal7580.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 4e50286a4cc..1dabed286b4 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;