Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 28 Dec 2017 05:33:24 +0000 (UTC)
From:      Warner Losh <imp@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r327264 - head/usr.sbin/cpucontrol
Message-ID:  <201712280533.vBS5XOgr024152@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: imp
Date: Thu Dec 28 05:33:24 2017
New Revision: 327264
URL: https://svnweb.freebsd.org/changeset/base/327264

Log:
  Use proper failure path rather than just returning.
  
  CID: 1199354, 1006894, 1006893, 1006892

Modified:
  head/usr.sbin/cpucontrol/intel.c
  head/usr.sbin/cpucontrol/via.c

Modified: head/usr.sbin/cpucontrol/intel.c
==============================================================================
--- head/usr.sbin/cpucontrol/intel.c	Thu Dec 28 05:33:19 2017	(r327263)
+++ head/usr.sbin/cpucontrol/intel.c	Thu Dec 28 05:33:24 2017	(r327264)
@@ -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);

Modified: head/usr.sbin/cpucontrol/via.c
==============================================================================
--- head/usr.sbin/cpucontrol/via.c	Thu Dec 28 05:33:19 2017	(r327263)
+++ head/usr.sbin/cpucontrol/via.c	Thu Dec 28 05:33:24 2017	(r327264)
@@ -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) {



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201712280533.vBS5XOgr024152>