usb: dfu: correct dfu buffer inited value
After dfu buffer is initialized, the buffer should be all available, while not 0. Initialize its value to min(dfu_buf_size, dfu->r_left). Signed-off-by: Bo Shen <voice.shen@atmel.com> Tested-by: Lukasz Majewski <l.majewski@samsung.com> Acked-by: Lukasz Majewski <l.majewski@samsung.com>
This commit is contained in:
parent
c2617bc773
commit
31bae4c5d9
@ -288,7 +288,7 @@ int dfu_read(struct dfu_entity *dfu, void *buf, int size, int blk_seq_num)
|
||||
dfu->offset = 0;
|
||||
dfu->i_buf_end = dfu_get_buf() + dfu_buf_size;
|
||||
dfu->i_buf = dfu->i_buf_start;
|
||||
dfu->b_left = 0;
|
||||
dfu->b_left = min(dfu_buf_size, dfu->r_left);
|
||||
|
||||
dfu->bad_skip = 0;
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user