From d79dc9b482b37d216fbd9f6d4bc5bc8a7fee85e2 Mon Sep 17 00:00:00 2001 From: Warner Losh Date: Thu, 28 Dec 2017 05:33:24 +0000 Subject: [PATCH] Use proper failure path rather than just returning. CID: 1199354, 1006894, 1006893, 1006892 --- usr.sbin/cpucontrol/intel.c | 2 +- usr.sbin/cpucontrol/via.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/usr.sbin/cpucontrol/intel.c b/usr.sbin/cpucontrol/intel.c index d7bfd27f6c3..362dbafcf7b 100644 --- a/usr.sbin/cpucontrol/intel.c +++ b/usr.sbin/cpucontrol/intel.c @@ -261,7 +261,7 @@ matched: if (revision >= fw_header->revision) { WARNX(1, "skipping %s of rev %#x: up to date", path, fw_header->revision); - return; + goto fail; } fprintf(stderr, "%s: updating cpu %s from rev %#x to rev %#x... ", path, dev, revision, fw_header->revision); diff --git a/usr.sbin/cpucontrol/via.c b/usr.sbin/cpucontrol/via.c index 63d814c5503..354817edf85 100644 --- a/usr.sbin/cpucontrol/via.c +++ b/usr.sbin/cpucontrol/via.c @@ -140,7 +140,7 @@ via_update(const char *dev, const char *path) fd = open(path, O_RDONLY, 0); if (fd < 0) { WARN(0, "open(%s)", path); - return; + goto fail; } error = fstat(fd, &st); if (error != 0) {