From: Lukasz Majewski <l.majewski@samsung.com>
To: u-boot@lists.denx.de
Subject: [U-Boot] [PATCH 3/3] dfu: fix readback buffer overflow test
Date: Tue, 08 Jul 2014 09:58:46 +0200 [thread overview]
Message-ID: <20140708095846.75f9c033@amdc2363> (raw)
In-Reply-To: <1404238617-30522-3-git-send-email-swarren@wwwdotorg.org>
Hi Stephen,
> From: Stephen Warren <swarren@nvidia.com>
>
> The buffer is too small if it's < size to read, not if it's <= the
> size. This fixes the 1MB test case on Tegra, which has a 1MB buffer.
>
> Signed-off-by: Stephen Warren <swarren@nvidia.com>
> ---
> drivers/dfu/dfu.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/dfu/dfu.c b/drivers/dfu/dfu.c
> index 6cd3fbb58ae4..3512b149c560 100644
> --- a/drivers/dfu/dfu.c
> +++ b/drivers/dfu/dfu.c
> @@ -332,7 +332,7 @@ int dfu_read(struct dfu_entity *dfu, void *buf,
> int size, int blk_seq_num) case DFU_RAM_ADDR:
> break;
> default:
> - if (dfu->r_left >= dfu_buf_size) {
> + if (dfu->r_left > dfu_buf_size) {
> printf("%s: File too big for
> buffer\n", __func__);
> return -EOVERFLOW;
Applied to u-boot-dfu tree.
Stephen, thanks for your support.
--
Best regards,
Lukasz Majewski
Samsung R&D Institute Poland (SRPOL) | Linux Platform Group
next prev parent reply other threads:[~2014-07-08 7:58 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-07-01 18:16 [U-Boot] [PATCH 1/3] test: dfu: cleanup before execution Stephen Warren
2014-07-01 18:16 ` [U-Boot] [PATCH 2/3] test: dfu: add some more test cases Stephen Warren
2014-07-08 7:58 ` Lukasz Majewski
2014-07-01 18:16 ` [U-Boot] [PATCH 3/3] dfu: fix readback buffer overflow test Stephen Warren
2014-07-08 7:58 ` Lukasz Majewski [this message]
2014-07-08 7:57 ` [U-Boot] [PATCH 1/3] test: dfu: cleanup before execution Lukasz Majewski
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20140708095846.75f9c033@amdc2363 \
--to=l.majewski@samsung.com \
--cc=u-boot@lists.denx.de \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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.