Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 4aa69d56 authored by Jaegeuk Kim's avatar Jaegeuk Kim
Browse files

f2fs: return early when trying to read null nid



If get_node_page() gets zero nid, we can return early without getting a wrong
page. For example, get_dnode_of_data() can try to do that.

Signed-off-by: default avatarJaegeuk Kim <jaegeuk@kernel.org>
parent 2aadac08
Loading
Loading
Loading
Loading
+4 −0
Original line number Diff line number Diff line
@@ -1059,6 +1059,10 @@ struct page *get_node_page(struct f2fs_sb_info *sbi, pgoff_t nid)
{
	struct page *page;
	int err;

	if (!nid)
		return ERR_PTR(-ENOENT);
	f2fs_bug_on(sbi, check_nid_range(sbi, nid));
repeat:
	page = grab_cache_page(NODE_MAPPING(sbi), nid);
	if (!page)