From: Stephen Warren Date: Tue, 1 Jul 2014 18:16:57 +0000 (-0600) Subject: dfu: fix readback buffer overflow test X-Git-Url: http://git.lede-project.org./?a=commitdiff_plain;h=67ab0a5e9f295662e6c1363a6cb71d4dd9d51524;p=project%2Fbcm63xx%2Fu-boot.git dfu: fix readback buffer overflow test 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 --- diff --git a/drivers/dfu/dfu.c b/drivers/dfu/dfu.c index 6cd3fbb58a..3512b149c5 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;