[PATCH] usb: gadget: fastboot: close fd after download

Sascha Hauer s.hauer at pengutronix.de
Thu Feb 23 05:50:07 PST 2017


The fd for the downloaded file is never closed. Fix this.

Signed-off-by: Sascha Hauer <s.hauer at pengutronix.de>
---
 drivers/usb/gadget/f_fastboot.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/drivers/usb/gadget/f_fastboot.c b/drivers/usb/gadget/f_fastboot.c
index a6192b9ebd..974b0b32eb 100644
--- a/drivers/usb/gadget/f_fastboot.c
+++ b/drivers/usb/gadget/f_fastboot.c
@@ -597,6 +597,7 @@ static void rx_handler_dl_image(struct usb_ep *ep, struct usb_request *req)
 	if (f_fb->download_bytes >= f_fb->download_size) {
 		req->complete = rx_handler_command;
 		req->length = EP_BUFFER_SIZE;
+		close(f_fb->download_fd);
 
 		fastboot_tx_print(f_fb, "INFODownloading %d bytes finished",
 				f_fb->download_bytes);
-- 
2.11.0




More information about the barebox mailing list