usb: ums: add error handling for failed registration
Without this, if g_dnl_register() fails, the UMS code continues on blindly and crashes. This fix makes it simply print an error message instead. Signed-off-by: Stephen Warren <swarren@nvidia.com>
This commit is contained in:
parent
340ed422d2
commit
66b88b07cd
@ -40,7 +40,11 @@ int do_usb_mass_storage(cmd_tbl_t *cmdtp, int flag,
|
||||
return CMD_RET_FAILURE;
|
||||
}
|
||||
|
||||
g_dnl_register("usb_dnl_ums");
|
||||
rc = g_dnl_register("usb_dnl_ums");
|
||||
if (rc) {
|
||||
error("g_dnl_register failed");
|
||||
return CMD_RET_FAILURE;
|
||||
}
|
||||
|
||||
/* Timeout unit: seconds */
|
||||
int cable_ready_timeout = UMS_CABLE_READY_TIMEOUT;
|
||||
|
Loading…
Reference in New Issue
Block a user