summaryrefslogtreecommitdiffstats
path: root/fs/sysv/dir.c
diff options
context:
space:
mode:
authorDan Carpenter2010-04-21 12:30:32 +0200
committerAl Viro2010-05-15 13:16:33 +0200
commit404e781249f003a37a140756fc4aeae463dcb217 (patch)
tree5eb0f81657ebecdd747583df54a261a4e305df3f /fs/sysv/dir.c
parentFix double-free in logfs (diff)
downloadkernel-qcow2-linux-404e781249f003a37a140756fc4aeae463dcb217.tar.gz
kernel-qcow2-linux-404e781249f003a37a140756fc4aeae463dcb217.tar.xz
kernel-qcow2-linux-404e781249f003a37a140756fc4aeae463dcb217.zip
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 <error27@gmail.com> Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
Diffstat (limited to 'fs/sysv/dir.c')
-rw-r--r--fs/sysv/dir.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/fs/sysv/dir.c b/fs/sysv/dir.c
index 4e50286a4cc3..1dabed286b4c 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;