提交 1e03e38b 编写于 作者: J Jason Hrycay 提交者: Jaegeuk Kim

f2fs: handle errors from get_node_page calls

Add check for error pointers returned from get_node_page in order to
avoid dereferencing a bad address on the next use.
Signed-off-by: NJason Hrycay <jason.hrycay@motorola.com>
Signed-off-by: NJaegeuk Kim <jaegeuk.kim@samsung.com>
上级 83d5d6f6
......@@ -218,6 +218,8 @@ int f2fs_getxattr(struct inode *inode, int name_index, const char *name,
return -ENODATA;
page = get_node_page(sbi, fi->i_xattr_nid);
if (IS_ERR(page))
return PTR_ERR(page);
base_addr = page_address(page);
list_for_each_xattr(entry, base_addr) {
......@@ -268,6 +270,8 @@ ssize_t f2fs_listxattr(struct dentry *dentry, char *buffer, size_t buffer_size)
return 0;
page = get_node_page(sbi, fi->i_xattr_nid);
if (IS_ERR(page))
return PTR_ERR(page);
base_addr = page_address(page);
list_for_each_xattr(entry, base_addr) {
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册