Skip to content

Commit

Permalink
thor: fix error path after g_dnl_register() failure
Browse files Browse the repository at this point in the history
Set command return value and perform needed cleanup when g_dnl_register()
function fails.

Signed-off-by: Marek Szyprowski <[email protected]>
  • Loading branch information
mszyprow authored and Marek Vasut committed Oct 31, 2019
1 parent fd15b58 commit 0896d2c
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion cmd/thordown.c
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,8 @@ int do_thor_down(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
ret = g_dnl_register("usb_dnl_thor");
if (ret) {
pr_err("g_dnl_register failed %d\n", ret);
return ret;
ret = CMD_RET_FAILURE;
goto exit;
}

ret = thor_init();
Expand Down

0 comments on commit 0896d2c

Please sign in to comment.