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 <swarren@nvidia.com>
master
Stephen Warren 10 years ago committed by Tom Rini
parent 54ce79c8a5
commit 67ab0a5e9f
  1. 2
      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;

Loading…
Cancel
Save