From 2bf1a81a2f0cd9d1e0f7aea93ea49185e7fb5ddf Mon Sep 17 00:00:00 2001 From: Stephen Hemminger Date: Sat, 18 Feb 2017 16:17:43 -0800 Subject: [PATCH] utils: hex2mem get rid of unnecessary goto Signed-off-by: Stephen Hemminger --- lib/utils.c | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/lib/utils.c b/lib/utils.c index 870c4f1b8..6d5642f4f 100644 --- a/lib/utils.c +++ b/lib/utils.c @@ -970,21 +970,18 @@ int hex2mem(const char *buf, uint8_t *mem, int count) for (i = 0, j = 0; i < count; i++, j += 2) { c = get_hex(buf[j]); if (c < 0) - goto err; + return -1; mem[i] = c << 4; c = get_hex(buf[j + 1]); if (c < 0) - goto err; + return -1; mem[i] |= c; } return 0; - -err: - return -1; } int addr64_n2a(__u64 addr, char *buff, size_t len) -- 2.47.2