mirror of
https://git.codelinaro.org/clo/qsdk/oss/boot/u-boot-2016.git
synced 2026-03-09 10:47:41 +01:00
cmd: dfu: Add error handling for failed registration
Without this, if g_dnl_register() fails, DFU code continues on blindly and crashes. This fix makes it simply print an error message instead. Signed-off-by: Sanchayan Maity <maitysanchayan@gmail.com> [l.majewski@samsung.com - some manual tweaks needed]
This commit is contained in:
parent
cdb1808aef
commit
54a708ca06
1 changed files with 6 additions and 1 deletions
|
|
@ -26,7 +26,12 @@ int run_usb_dnl_gadget(int usbctrl_index, char *usb_dnl_gadget)
|
|||
|
||||
board_usb_init(usbctrl_index, USB_INIT_DEVICE);
|
||||
g_dnl_clear_detach();
|
||||
g_dnl_register(usb_dnl_gadget);
|
||||
ret = g_dnl_register(usb_dnl_gadget);
|
||||
if (ret) {
|
||||
error("g_dnl_register failed");
|
||||
return CMD_RET_FAILURE;
|
||||
}
|
||||
|
||||
while (1) {
|
||||
if (g_dnl_detach()) {
|
||||
/*
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue