summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorKaho Ng <ngkaho1234@gmail.com>2017-02-27 22:49:53 +0800
committerKaho Ng <ngkaho1234@gmail.com>2017-02-27 22:49:53 +0800
commit4d530fc1bbb24770246a83beb161a4b9d394f817 (patch)
tree1cddd2ffe72793f58cd65056ac9ac8071fcfb82e /src
parent12af982ed6f006c0ff4b73a2dc266d139d490904 (diff)
ext4_xattr: fix trying to read EA block even if it is absent
Diffstat (limited to 'src')
-rw-r--r--src/ext4_xattr.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/src/ext4_xattr.c b/src/ext4_xattr.c
index 6e09643..bcddefb 100644
--- a/src/ext4_xattr.c
+++ b/src/ext4_xattr.c
@@ -974,6 +974,13 @@ int ext4_xattr_get(struct ext4_inode_ref *inode_ref, uint8_t name_index,
}
} else {
struct ext4_block block;
+
+ /* Return ENODATA if there is no EA block */
+ if (!xattr_block) {
+ ret = ENODATA;
+ goto out;
+ }
+
block_finder.i = i;
ret = ext4_trans_block_get(fs->bdev, &block, xattr_block);
if (ret != EOK)