The aw_fel_process_spl_and_uboot() was missing a free() for the file
buffer. This patch also adds a proper libusb cleanup/shutdown.

Signed-off-by: Bernhard Nortmann <bernhard.nortm...@web.de>
---
 fel.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/fel.c b/fel.c
index fdd6d35..59f0f72 100644
--- a/fel.c
+++ b/fel.c
@@ -1137,6 +1137,7 @@ void aw_fel_process_spl_and_uboot(libusb_device_handle 
*usb,
        /* check for optional main U-Boot binary (and transfer it, if 
applicable) */
        if (size > SPL_LEN_LIMIT)
                aw_fel_write_uboot_image(usb, buf + SPL_LEN_LIMIT, size - 
SPL_LEN_LIMIT);
+       free(buf);
 }
 
 /*
@@ -1440,6 +1441,8 @@ int main(int argc, char **argv)
        if (iface_detached >= 0)
                libusb_attach_kernel_driver(handle, iface_detached);
 #endif
+       libusb_close(handle);
+       libusb_exit(NULL);
 
        return 0;
 }
-- 
2.4.6

-- 
You received this message because you are subscribed to the Google Groups 
"linux-sunxi" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to linux-sunxi+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to