* [U-Boot] [PATCH] usb: ums: add error handling for failed registration
@ 2014-05-01 21:42 Stephen Warren
2014-05-05 19:43 ` Marek Vasut
0 siblings, 1 reply; 3+ messages in thread
From: Stephen Warren @ 2014-05-01 21:42 UTC (permalink / raw)
To: u-boot
From: Stephen Warren <swarren@nvidia.com>
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>
---
common/cmd_usb_mass_storage.c | 6 +++++-
1 file changed, 5 insertions(+), 1 deletion(-)
diff --git a/common/cmd_usb_mass_storage.c b/common/cmd_usb_mass_storage.c
index d8d9efd4f62b..31b7eb0b57ef 100644
--- a/common/cmd_usb_mass_storage.c
+++ b/common/cmd_usb_mass_storage.c
@@ -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;
--
1.8.1.5
^ permalink raw reply related [flat|nested] 3+ messages in thread* [U-Boot] [PATCH] usb: ums: add error handling for failed registration
2014-05-01 21:42 [U-Boot] [PATCH] usb: ums: add error handling for failed registration Stephen Warren
@ 2014-05-05 19:43 ` Marek Vasut
2014-05-06 6:17 ` Lukasz Majewski
0 siblings, 1 reply; 3+ messages in thread
From: Marek Vasut @ 2014-05-05 19:43 UTC (permalink / raw)
To: u-boot
On Thursday, May 01, 2014 at 11:42:10 PM, Stephen Warren wrote:
> From: Stephen Warren <swarren@nvidia.com>
>
> 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>
Acked-by: Marek Vasut <marex@denx.de>
Lukasz, can you pick this please?
Best regards,
Marek Vasut
^ permalink raw reply [flat|nested] 3+ messages in thread
* [U-Boot] [PATCH] usb: ums: add error handling for failed registration
2014-05-05 19:43 ` Marek Vasut
@ 2014-05-06 6:17 ` Lukasz Majewski
0 siblings, 0 replies; 3+ messages in thread
From: Lukasz Majewski @ 2014-05-06 6:17 UTC (permalink / raw)
To: u-boot
Hi Marek,
> On Thursday, May 01, 2014 at 11:42:10 PM, Stephen Warren wrote:
> > From: Stephen Warren <swarren@nvidia.com>
> >
> > 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>
>
> Acked-by: Marek Vasut <marex@denx.de>
>
> Lukasz, can you pick this please?
>
> Best regards,
> Marek Vasut
Applied to u-boot-dfu. Thanks.
--
Best regards,
Lukasz Majewski
Samsung R&D Institute Poland (SRPOL) | Linux Platform Group
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2014-05-06 6:17 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-05-01 21:42 [U-Boot] [PATCH] usb: ums: add error handling for failed registration Stephen Warren
2014-05-05 19:43 ` Marek Vasut
2014-05-06 6:17 ` Lukasz Majewski
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox