Skip to content

Commit 404e781

Browse files
error27Al Viro
authored andcommitted
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>
1 parent 2656244 commit 404e781

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

‎fs/sysv/dir.c‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -164,8 +164,8 @@ struct sysv_dir_entry *sysv_find_entry(struct dentry *dentry, struct page **res_
164164
name, de->name))
165165
goto found;
166166
}
167+
dir_put_page(page);
167168
}
168-
dir_put_page(page);
169169

170170
if (++n >= npages)
171171
n = 0;

0 commit comments

Comments
 (0)