Skip to contentSkip to conversation

ntfs3: Remove duplicate code

PATCH New Muhammad Usama Anjum 1 participant 1 message Sep 6, 2024 NTFS3 filesystem

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 ntfs3: Remove duplicate code

Don't check validity of asize second time once it has been checked before. Remove the duplicate code.

Fixes 556bdf27c2dd ("ntfs3: Add bounds checking to mi_enum_attr()")
---
 fs/ntfs3/record.c | 4 ----
 1 file changed, 4 deletions(-)
fs/ntfs3/record.c +0 -4
index 427c71be0f087..0f400366231d5 100644
@@ -268,10 +268,6 @@ struct ATTRIB *mi_enum_attr(struct mft_inode *mi, struct ATTRIB *attr)
 
 	/* Check size of attribute. */
 	if (!attr->non_res) {
-		/* Check resident fields. */
-		if (asize < SIZEOF_RESIDENT)
-			return NULL;
-
 		t16 = le16_to_cpu(attr->res.data_off);
 		if (t16 > asize)
 			return NULL;
Signature · 1 line
2.39.2