[PATCH] usb: gadget: fastboot: delete temporary file

Sascha Hauer s.hauer at pengutronix.de
Wed Apr 12 03:10:32 PDT 2017


After we have copied the data to its final destination there is
no need to keep the temporary file around. Remove it when done
with it.

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

diff --git a/drivers/usb/gadget/f_fastboot.c b/drivers/usb/gadget/f_fastboot.c
index ef5f7ec6e0..598637619d 100644
--- a/drivers/usb/gadget/f_fastboot.c
+++ b/drivers/usb/gadget/f_fastboot.c
@@ -758,6 +758,9 @@ static void cb_flash(struct usb_ep *ep, struct usb_request *req, const char *cmd
 
 copy:
 	ret = copy_file(FASTBOOT_TMPFILE, filename, 1);
+
+	unlink(FASTBOOT_TMPFILE);
+
 	if (ret) {
 		fastboot_tx_print(f_fb, "FAILwrite partition: %s", strerror(-ret));
 		return;
-- 
2.11.0




More information about the barebox mailing list