From: Michal Simek Date: Thu, 19 Apr 2018 13:15:25 +0000 (+0200) Subject: cmd: clk: Check return value from soc_clk_dump X-Git-Tag: v2018.05-rc3~44^2 X-Git-Url: https://git.sur5r.net/?a=commitdiff_plain;h=ebc675b98d92f7b8264ca84e65cc896d95f9868b;p=u-boot cmd: clk: Check return value from soc_clk_dump In case of error in soc_clk_dump function are returned different values then CMD return values (-1, 0, 1). For example: ZynqMP> clk dump exit not allowed from main input shel The patch is checking all negative return values and return CMD_RET_FAILURE which is proper reaction for these cases. Signed-off-by: Michal Simek --- diff --git a/cmd/clk.c b/cmd/clk.c index 6d3d46a184..52b25405ce 100644 --- a/cmd/clk.c +++ b/cmd/clk.c @@ -16,7 +16,15 @@ int __weak soc_clk_dump(void) static int do_clk_dump(cmd_tbl_t *cmdtp, int flag, int argc, char *const argv[]) { - return soc_clk_dump(); + int ret; + + ret = soc_clk_dump(); + if (ret < 0) { + printf("Clock dump error %d\n", ret); + ret = CMD_RET_FAILURE; + } + + return ret; } static cmd_tbl_t cmd_clk_sub[] = {