diff options
author | Sascha Hauer <s.hauer@pengutronix.de> | 2018-02-02 14:01:30 +0100 |
---|---|---|
committer | Sascha Hauer <s.hauer@pengutronix.de> | 2018-02-09 10:24:11 +0100 |
commit | 09788a0b9d2b9a56cb444db1149072005e8a82c3 (patch) | |
tree | 8f9c725facacd4c10b381c3eccf085ecd0306c0b /drivers/usb/gadget | |
parent | bb89b4eedcfb24f3ff776800c0de56869d4c432b (diff) | |
download | barebox-09788a0b9d2b9a56cb444db1149072005e8a82c3.tar.gz barebox-09788a0b9d2b9a56cb444db1149072005e8a82c3.tar.xz |
usb: gadget: fastboot: use read_file_2
read_file_2 gives us a proper error code and allows us
to specify a maximum size which in this case we happen to know.
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Diffstat (limited to 'drivers/usb/gadget')
-rw-r--r-- | drivers/usb/gadget/f_fastboot.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/drivers/usb/gadget/f_fastboot.c b/drivers/usb/gadget/f_fastboot.c index 81522cbba6..62b13bcb8c 100644 --- a/drivers/usb/gadget/f_fastboot.c +++ b/drivers/usb/gadget/f_fastboot.c @@ -947,8 +947,9 @@ static void cb_flash(struct f_fastboot *f_fb, const char *cmd) fastboot_tx_print(f_fb, "INFOThis is a barebox image..."); - image = read_file(data.imagefile, &data.len); - if (!image) { + ret = read_file_2(data.imagefile, &data.len, &image, + f_fb->download_size); + if (ret) { fastboot_tx_print(f_fb, "FAILreading barebox"); return; } |