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]
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()) {
/*