Patchwork [U-Boot,08/10] dfu: Properly zero out timeout value

login
register
mail settings
Submitter Pantelis Antoniou
Date Nov. 29, 2012, 7:33 a.m.
Message ID <1354174439-5589-9-git-send-email-panto@antoniou-consulting.com>
Download mbox | patch
Permalink /patch/202413/
State Superseded
Delegated to: Marek Vasut
Headers show

Comments

Ɓukasz Majewski - Nov. 28, 2012, 3:23 p.m.
Hi Pantelis,

> Zero out timeout value; letting it filled with undefined values
> ends up with the dfu host hanging.
> 
> Signed-off-by: Pantelis Antoniou <panto@antoniou-consulting.com>
> ---
>  drivers/usb/gadget/f_dfu.c | 3 +++
>  1 file changed, 3 insertions(+)
> 
> diff --git a/drivers/usb/gadget/f_dfu.c b/drivers/usb/gadget/f_dfu.c
> index 6494f5e..c15585c 100644
> --- a/drivers/usb/gadget/f_dfu.c
> +++ b/drivers/usb/gadget/f_dfu.c
> @@ -164,6 +164,9 @@ static void handle_getstatus(struct usb_request
> *req) 
>  	/* send status response */
>  	dstat->bStatus = f_dfu->dfu_status;
> +	dstat->bwPollTimeout[0] = 0;
> +	dstat->bwPollTimeout[1] = 0;
> +	dstat->bwPollTimeout[2] = 0;
>  	dstat->bState = f_dfu->dfu_state;
>  	dstat->iString = 0;
>  }

Acked-by: Lukasz Majewski <l.majewski@samsung.com>
Pantelis Antoniou - Nov. 29, 2012, 7:33 a.m.
Zero out timeout value; letting it filled with undefined values
ends up with the dfu host hanging.

Signed-off-by: Pantelis Antoniou <panto@antoniou-consulting.com>
---
 drivers/usb/gadget/f_dfu.c | 3 +++
 1 file changed, 3 insertions(+)

Patch

diff --git a/drivers/usb/gadget/f_dfu.c b/drivers/usb/gadget/f_dfu.c
index 6494f5e..c15585c 100644
--- a/drivers/usb/gadget/f_dfu.c
+++ b/drivers/usb/gadget/f_dfu.c
@@ -164,6 +164,9 @@  static void handle_getstatus(struct usb_request *req)
 
 	/* send status response */
 	dstat->bStatus = f_dfu->dfu_status;
+	dstat->bwPollTimeout[0] = 0;
+	dstat->bwPollTimeout[1] = 0;
+	dstat->bwPollTimeout[2] = 0;
 	dstat->bState = f_dfu->dfu_state;
 	dstat->iString = 0;
 }