diff options
Diffstat (limited to 'utils/jz4740_tools/jz4740_usbtool.c')
-rw-r--r-- | utils/jz4740_tools/jz4740_usbtool.c | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/utils/jz4740_tools/jz4740_usbtool.c b/utils/jz4740_tools/jz4740_usbtool.c index 74372aa632..1fdb8f4d46 100644 --- a/utils/jz4740_tools/jz4740_usbtool.c +++ b/utils/jz4740_tools/jz4740_usbtool.c | |||
@@ -159,7 +159,7 @@ int filesize(FILE* fd) | |||
159 | int upload_app(usb_dev_handle* dh, int address, unsigned char* p, int len, bool stage2) | 159 | int upload_app(usb_dev_handle* dh, int address, unsigned char* p, int len, bool stage2) |
160 | { | 160 | { |
161 | int err; | 161 | int err; |
162 | char buf[8]; | 162 | char buf[9]; |
163 | unsigned char* tmp_buf; | 163 | unsigned char* tmp_buf; |
164 | 164 | ||
165 | fprintf(stderr, "[INFO] GET_CPU_INFO: "); | 165 | fprintf(stderr, "[INFO] GET_CPU_INFO: "); |
@@ -207,7 +207,7 @@ int upload_app(usb_dev_handle* dh, int address, unsigned char* p, int len, bool | |||
207 | int read_data(usb_dev_handle* dh, int address, unsigned char *p, int len) | 207 | int read_data(usb_dev_handle* dh, int address, unsigned char *p, int len) |
208 | { | 208 | { |
209 | int err; | 209 | int err; |
210 | char buf[8]; | 210 | char buf[9]; |
211 | 211 | ||
212 | fprintf(stderr, "[INFO] GET_CPU_INFO: "); | 212 | fprintf(stderr, "[INFO] GET_CPU_INFO: "); |
213 | GET_CPU_INFO(buf); | 213 | GET_CPU_INFO(buf); |
@@ -577,6 +577,8 @@ int nand_dump(usb_dev_handle *dh) | |||
577 | { | 577 | { |
578 | fprintf(stderr,"\n[ERR] Error writing data\n"); | 578 | fprintf(stderr,"\n[ERR] Error writing data\n"); |
579 | fprintf(stderr,"[ERR] Bulk write error (%d, %s)\n", err, strerror(-err)); | 579 | fprintf(stderr,"[ERR] Bulk write error (%d, %s)\n", err, strerror(-err)); |
580 | fclose(fd); | ||
581 | free(buffer); | ||
580 | return -1; | 582 | return -1; |
581 | } | 583 | } |
582 | 584 | ||
@@ -628,6 +630,8 @@ int rom_dump(usb_dev_handle *dh) | |||
628 | { | 630 | { |
629 | fprintf(stderr,"\n[ERR] Error writing data\n"); | 631 | fprintf(stderr,"\n[ERR] Error writing data\n"); |
630 | fprintf(stderr,"[ERR] Bulk write error (%d, %s)\n", err, strerror(-err)); | 632 | fprintf(stderr,"[ERR] Bulk write error (%d, %s)\n", err, strerror(-err)); |
633 | fclose(fd); | ||
634 | free(buffer); | ||
631 | return -1; | 635 | return -1; |
632 | } | 636 | } |
633 | 637 | ||