From owner-svn-src-all@freebsd.org Mon Nov 13 09:07:31 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id D0CF7D7E320; Mon, 13 Nov 2017 09:07:31 +0000 (UTC) (envelope-from kib@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 mx1.freebsd.org (Postfix) with ESMTPS id 7F64C66AA4; Mon, 13 Nov 2017 09:07:31 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id vAD97UPR032556; Mon, 13 Nov 2017 09:07:30 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id vAD97UfS032555; Mon, 13 Nov 2017 09:07:30 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201711130907.vAD97UfS032555@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Mon, 13 Nov 2017 09:07:30 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r325756 - stable/11/sys/dev/hwpmc X-SVN-Group: stable-11 X-SVN-Commit-Author: kib X-SVN-Commit-Paths: stable/11/sys/dev/hwpmc X-SVN-Commit-Revision: 325756 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 13 Nov 2017 09:07:32 -0000 Author: kib Date: Mon Nov 13 09:07:30 2017 New Revision: 325756 URL: https://svnweb.freebsd.org/changeset/base/325756 Log: MFC r325671: Check that the pmc index is less than the number of hardware PMCs, instead of asserting the condition. Modified: stable/11/sys/dev/hwpmc/hwpmc_mod.c Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/dev/hwpmc/hwpmc_mod.c ============================================================================== --- stable/11/sys/dev/hwpmc/hwpmc_mod.c Mon Nov 13 07:47:43 2017 (r325755) +++ stable/11/sys/dev/hwpmc/hwpmc_mod.c Mon Nov 13 09:07:30 2017 (r325756) @@ -2578,10 +2578,9 @@ pmc_find_pmc(pmc_id_t pmcid, struct pmc **pmc) struct pmc_owner *po; struct pmc_process *pp; - KASSERT(PMC_ID_TO_ROWINDEX(pmcid) < md->pmd_npmc, - ("[pmc,%d] Illegal pmc index %d (max %d)", __LINE__, - PMC_ID_TO_ROWINDEX(pmcid), md->pmd_npmc)); PMCDBG1(PMC,FND,1, "find-pmc id=%d", pmcid); + if (PMC_ID_TO_ROWINDEX(pmcid) >= md->pmd_npmc) + return (EINVAL); if ((po = pmc_find_owner_descriptor(curthread->td_proc)) == NULL) { /*