thor: fix crash after usb initialization failure
Registration of USB download gadget might fail for various reasons, so add a check for g_dnl_register() funtion return value. Without this fix, thor_init() will try to access the registered gadget structures resulting in NULL pointer dereference issue. Signed-off-by: Marek Szyprowski <m.szyprowski@samsung.com>
This commit is contained in:
parent
160102d112
commit
ed3a37a248
@ -37,7 +37,11 @@ int do_thor_down(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
|
|||||||
goto exit;
|
goto exit;
|
||||||
}
|
}
|
||||||
|
|
||||||
g_dnl_register("usb_dnl_thor");
|
ret = g_dnl_register("usb_dnl_thor");
|
||||||
|
if (ret) {
|
||||||
|
pr_err("g_dnl_register failed %d\n", ret);
|
||||||
|
return ret;
|
||||||
|
}
|
||||||
|
|
||||||
ret = thor_init();
|
ret = thor_init();
|
||||||
if (ret) {
|
if (ret) {
|
||||||
|
Loading…
Reference in New Issue
Block a user