* [U-Boot] [PATCH] Bug in cbfs
@ 2016-07-22 10:21 Yaroslav K.
2016-07-23 2:57 ` Simon Glass
2016-08-06 0:06 ` Bin Meng
0 siblings, 2 replies; 5+ messages in thread
From: Yaroslav K. @ 2016-07-22 10:21 UTC (permalink / raw)
To: u-boot
cbfs: Fix incorrect CBFS file header size being used
This fixes incorrect filenames in cbfsls output.
Signed-off-by: Yaroslav K. <yar444@gmail.com>
---
fs/cbfs/cbfs.c | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/fs/cbfs/cbfs.c b/fs/cbfs/cbfs.c
index 95a48a4..bfe8e2c 100644
--- a/fs/cbfs/cbfs.c
+++ b/fs/cbfs/cbfs.c
@@ -97,7 +97,7 @@ 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 *) ||
+ 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;
--
1.9.1
^ permalink raw reply related [flat|nested] 5+ messages in thread
* [U-Boot] [PATCH] Bug in cbfs
2016-07-22 10:21 [U-Boot] [PATCH] Bug in cbfs Yaroslav K.
@ 2016-07-23 2:57 ` Simon Glass
2016-08-06 0:06 ` Bin Meng
1 sibling, 0 replies; 5+ messages in thread
From: Simon Glass @ 2016-07-23 2:57 UTC (permalink / raw)
To: u-boot
On 22 July 2016 at 04:21, Yaroslav K. <yar444@gmail.com> wrote:
> cbfs: Fix incorrect CBFS file header size being used
>
> This fixes incorrect filenames in cbfsls output.
>
> Signed-off-by: Yaroslav K. <yar444@gmail.com>
> ---
> fs/cbfs/cbfs.c | 6 +++---
> 1 file changed, 3 insertions(+), 3 deletions(-)
Reviewed-by: Simon Glass <sjg@chromium.org>
^ permalink raw reply [flat|nested] 5+ messages in thread
* [U-Boot] [PATCH] Bug in cbfs
2016-07-22 10:21 [U-Boot] [PATCH] Bug in cbfs Yaroslav K.
2016-07-23 2:57 ` Simon Glass
@ 2016-08-06 0:06 ` Bin Meng
1 sibling, 0 replies; 5+ messages in thread
From: Bin Meng @ 2016-08-06 0:06 UTC (permalink / raw)
To: u-boot
Hi Yaroslav,
On Fri, Jul 22, 2016 at 6:21 PM, Yaroslav K. <yar444@gmail.com> wrote:
> cbfs: Fix incorrect CBFS file header size being used
Please make this the email title of this patch.
>
> This fixes incorrect filenames in cbfsls output.
>
> Signed-off-by: Yaroslav K. <yar444@gmail.com>
> ---
> fs/cbfs/cbfs.c | 6 +++---
> 1 file changed, 3 insertions(+), 3 deletions(-)
>
> diff --git a/fs/cbfs/cbfs.c b/fs/cbfs/cbfs.c
> index 95a48a4..bfe8e2c 100644
> --- a/fs/cbfs/cbfs.c
> +++ b/fs/cbfs/cbfs.c
> @@ -97,7 +97,7 @@ 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 *) ||
> + 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;
>
> --
There are lots of style issues. Please fix this.
ERROR: code indent should use tabs where possible
#32: FILE: fs/cbfs/cbfs.c:100:
+ if (header.offset < sizeof(struct cbfs_fileheader) ||$
WARNING: please, no spaces at the start of a line
#32: FILE: fs/cbfs/cbfs.c:100:
+ if (header.offset < sizeof(struct cbfs_fileheader) ||$
WARNING: suspect code indent for conditional statements (15, 23)
#32: FILE: fs/cbfs/cbfs.c:100:
+ if (header.offset < sizeof(struct cbfs_fileheader) ||
[...]
file_cbfs_result = CBFS_BAD_FILE;
ERROR: patch seems to be corrupt (line wrapped?)
#37: FILE: fs/cbfs/cbfs.c:105:
size, u32 align,
ERROR: code indent should use tabs where possible
#42: FILE: fs/cbfs/cbfs.c:109:
+ name_len = header.offset - sizeof(struct cbfs_fileheader);$
WARNING: please, no spaces at the start of a line
#42: FILE: fs/cbfs/cbfs.c:109:
+ name_len = header.offset - sizeof(struct cbfs_fileheader);$
ERROR: code indent should use tabs where possible
#45: FILE: fs/cbfs/cbfs.c:111:
+ sizeof(struct cbfs_fileheader);$
WARNING: please, no spaces@the start of a line
#45: FILE: fs/cbfs/cbfs.c:111:
+ sizeof(struct cbfs_fileheader);$
total: 4 errors, 4 warnings, 0 checks, 19 lines checked
NOTE: whitespace errors detected, you may wish to use scripts/cleanpatch or
scripts/cleanfile
NOTE: Ignored message types: COMPLEX_MACRO CONSIDER_KSTRTO MINMAX
MULTISTATEMENT_MACRO_USE_DO_WHILE NETWORKING_BLOCK_COMMENT_STYLE
PREFER_ETHER_ADDR_COPY USLEEP_RANGE
U-Boot-Bug-in-cbfs.patch has style problems, please review.
Regards,
Bin
^ permalink raw reply [flat|nested] 5+ messages in thread
* [U-Boot] [PATCH] Bug in cbfs
2016-08-08 8:31 Yaroslav K.
@ 2016-08-09 2:41 ` Bin Meng
0 siblings, 0 replies; 5+ messages in thread
From: Bin Meng @ 2016-08-09 2:41 UTC (permalink / raw)
To: u-boot
Hi Yaroslav,
On Mon, Aug 8, 2016 at 4:31 PM, Yaroslav K. <yar444@gmail.com> wrote:
> Hi Bin.
>
> Could you please create proper patch yourself? The changes are trivial
> anyway, so it doesn't matter who author is.
>
> --
> Yaroslav
OK, will keep your SoB and clean up this patch.
Regards,
Bin
^ permalink raw reply [flat|nested] 5+ messages in thread
* [U-Boot] [PATCH] Bug in cbfs
@ 2016-08-08 8:31 Yaroslav K.
2016-08-09 2:41 ` Bin Meng
0 siblings, 1 reply; 5+ messages in thread
From: Yaroslav K. @ 2016-08-08 8:31 UTC (permalink / raw)
To: u-boot
Hi Bin.
Could you please create proper patch yourself? The changes are trivial
anyway, so it doesn't matter who author is.
--
Yaroslav
^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2016-08-09 2:41 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-07-22 10:21 [U-Boot] [PATCH] Bug in cbfs Yaroslav K.
2016-07-23 2:57 ` Simon Glass
2016-08-06 0:06 ` Bin Meng
2016-08-08 8:31 Yaroslav K.
2016-08-09 2:41 ` Bin Meng
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.