Skip to contentSkip to conversation

cbfs: Fix incorrect CBFS file header size being used

PATCH New Bin Meng 1 participant 2 messages Aug 9, 2016

lore
Share & tools
lore
author
#1 lore raw

PATCH v2 1/1 cbfs: Fix incorrect CBFS file header size being used

In reply to Bin Meng
Quoted 9 lines · Bin Meng

From: Yaroslav K <[email protected]>

This fixes incorrect filenames in cbfsls output.

[clean up checkpatch errors and warnings]
Quoted 8 lines

---

Changes in v2:
- Clean up checkpatch errors and warnings

 fs/cbfs/cbfs.c | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

applied to u-boot-x86, thanks!

Bin Meng

author
#0 lore raw

PATCH v2 1/1 cbfs: Fix incorrect CBFS file header size being used

From: Yaroslav K <[email protected]>

This fixes incorrect filenames in cbfsls output.

[clean up checkpatch errors and warnings]

---

Changes in v2:
- Clean up checkpatch errors and warnings

 fs/cbfs/cbfs.c | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)
fs/cbfs/cbfs.c +4 -4
index 95a48a4..6e1107d 100644
@@ -97,8 +97,8 @@ static int file_cbfs_next_file(u8 *start, u32 size, u32 align,
 		}
 
 		swap_file_header(&header, fileHeader);
-		if (header.offset < sizeof(const struct cbfs_cachenode *) ||
-				header.offset > header.len) {
+		if (header.offset < sizeof(struct cbfs_fileheader) ||
+		    header.offset > header.len) {
 			file_cbfs_result = CBFS_BAD_FILE;
 			return -1;
 		}
@@ -106,9 +106,9 @@ static int file_cbfs_next_file(u8 *start, u32 size, u32 align,
 		newNode->type = header.type;
 		newNode->data = start + header.offset;
 		newNode->data_length = header.len;
-		name_len = header.offset - sizeof(struct cbfs_cachenode *);
+		name_len = header.offset - sizeof(struct cbfs_fileheader);
 		newNode->name = (char *)fileHeader +
-				sizeof(struct cbfs_cachenode *);
+				sizeof(struct cbfs_fileheader);
 		newNode->name_length = name_len;
 		newNode->checksum = header.checksum;
 
Signature · 1 line
2.9.2