[U-Boot] thor: fix error path after g_dnl_register() failure
diff mbox series

Message ID 20191002122921.18693-1-m.szyprowski@samsung.com
State Accepted
Commit 0896d2caf7dc3babf9d518c6faabacb114bad6f2
Delegated to: Lukasz Majewski
Headers show
Series
  • [U-Boot] thor: fix error path after g_dnl_register() failure
Related show

Commit Message

Marek Szyprowski Oct. 2, 2019, 12:29 p.m. UTC
Set command return value and perform needed cleanup when g_dnl_register()
function fails.

Signed-off-by: Marek Szyprowski <m.szyprowski@samsung.com>
---
 cmd/thordown.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

Patch
diff mbox series

diff --git a/cmd/thordown.c b/cmd/thordown.c
index dd0544d475..8dae024e31 100644
--- a/cmd/thordown.c
+++ b/cmd/thordown.c
@@ -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();