From owner-svn-src-head@freebsd.org Thu Jun 14 22:31:31 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 1286F10110FB; Thu, 14 Jun 2018 22:31:31 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id BDAC78743F; Thu, 14 Jun 2018 22:31:30 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 9EF746E65; Thu, 14 Jun 2018 22:31:30 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w5EMVUWI057079; Thu, 14 Jun 2018 22:31:30 GMT (envelope-from jhb@FreeBSD.org) Received: (from jhb@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w5EMVUwP057078; Thu, 14 Jun 2018 22:31:30 GMT (envelope-from jhb@FreeBSD.org) Message-Id: <201806142231.w5EMVUwP057078@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jhb set sender to jhb@FreeBSD.org using -f From: John Baldwin Date: Thu, 14 Jun 2018 22:31:30 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r335181 - head/sbin/devmatch X-SVN-Group: head X-SVN-Commit-Author: jhb X-SVN-Commit-Paths: head/sbin/devmatch X-SVN-Commit-Revision: 335181 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 14 Jun 2018 22:31:31 -0000 Author: jhb Date: Thu Jun 14 22:31:30 2018 New Revision: 335181 URL: https://svnweb.freebsd.org/changeset/base/335181 Log: Exit with an error if a linker hints file can't be found. Continuing with a NULL hints variable just triggers a segfault later on. The other error cases in this function all exit for an error rather than warning. Reviewed by: imp MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D15579 Modified: head/sbin/devmatch/devmatch.c Modified: head/sbin/devmatch/devmatch.c ============================================================================== --- head/sbin/devmatch/devmatch.c Thu Jun 14 22:25:10 2018 (r335180) +++ head/sbin/devmatch/devmatch.c Thu Jun 14 22:31:30 2018 (r335181) @@ -120,12 +120,8 @@ read_linker_hints(void) continue; break; } - if (q == NULL) { - warnx("Can't read linker hints file."); - free(hints); - hints = NULL; - return; - } + if (q == NULL) + errx(1, "Can't read linker hints file."); } else { hints = read_hints(linker_hints, &len); if (hints == NULL)