Browse Source

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>
Dan Carpenter 15 năm trước cách đây
mục cha
commit
404e781249
1 tập tin đã thay đổi với 1 bổ sung1 xóa
  1. 1 1
      fs/sysv/dir.c

+ 1 - 1
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;