summaryrefslogtreecommitdiffstats
path: root/drivers
diff options
context:
space:
mode:
authorSascha Hauer <s.hauer@pengutronix.de>2017-04-12 12:08:24 +0200
committerSascha Hauer <s.hauer@pengutronix.de>2017-04-12 12:09:42 +0200
commit650228f100df7c52a80db7eb31dd3727ba5d267a (patch)
tree03d81a2ec6edc67db45d196d609496fb19123b0d /drivers
parentb612a54cec72fe5bd6ce22623e157c1787e167f1 (diff)
downloadbarebox-650228f100df7c52a80db7eb31dd3727ba5d267a.tar.gz
barebox-650228f100df7c52a80db7eb31dd3727ba5d267a.tar.xz
usb: gadget: fastboot: delete temporary file
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@pengutronix.de>
Diffstat (limited to 'drivers')
-rw-r--r--drivers/usb/gadget/f_fastboot.c3
1 files changed, 3 insertions, 0 deletions
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;