shithub: lwext4

Download patch

ref: 4d530fc1bbb24770246a83beb161a4b9d394f817
parent: 12af982ed6f006c0ff4b73a2dc266d139d490904
author: Kaho Ng <ngkaho1234@gmail.com>
date: Mon Feb 27 17:49:53 EST 2017

ext4_xattr: fix trying to read EA block even if it is absent

--- a/src/ext4_xattr.c
+++ b/src/ext4_xattr.c
@@ -974,6 +974,13 @@
 		}
 	} 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)