usb: ums: add error handling for failed registration
PATCH 1/1 usb: ums: add error handling for failed registration
From: Stephen Warren <[email protected]>
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.
--- common/cmd_usb_mass_storage.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-)
common/cmd_usb_mass_storage.c +5 -1
@@ -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 ;
Signature · 1 line
1.8.1.5
PATCH 1/1 usb: ums: add error handling for failed registration
Quoted 7 lines · Stephen Warren
From: Stephen Warren <[email protected]>
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 <[email protected]>
Lukasz, can you pick this please?
Best regards,
Marek Vasut
PATCH 1/1 usb: ums: add error handling for failed registration
Hi Marek,
Quoted 7 lines · Stephen Warren
Quoted 6 lines
From: Stephen Warren <[email protected]>
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.
Quoted 8 lines
Quoted 1 line
Signed-off-by Stephen Warren <[email protected]>Acked-by Marek Vasut <[email protected]>Lukasz, can you pick this please?
Best regards,
Marek Vasut
Applied to u-boot-dfu. Thanks.
Signature · 5 lines
Best regards, Lukasz Majewski Samsung R&D Institute Poland (SRPOL) | Linux Platform Group