From owner-svn-src-stable@freebsd.org Thu Jun 15 02:39:34 2017 Return-Path: Delivered-To: svn-src-stable@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 DAD38BFC924; Thu, 15 Jun 2017 02:39:34 +0000 (UTC) (envelope-from jkim@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 AB82F8341A; Thu, 15 Jun 2017 02:39:34 +0000 (UTC) (envelope-from jkim@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v5F2dXSX017462; Thu, 15 Jun 2017 02:39:33 GMT (envelope-from jkim@FreeBSD.org) Received: (from jkim@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v5F2dXSc017461; Thu, 15 Jun 2017 02:39:33 GMT (envelope-from jkim@FreeBSD.org) Message-Id: <201706150239.v5F2dXSc017461@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jkim set sender to jkim@FreeBSD.org using -f From: Jung-uk Kim Date: Thu, 15 Jun 2017 02:39:33 +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: r319963 - stable/11/sys/vm X-SVN-Group: stable-11 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 15 Jun 2017 02:39:35 -0000 Author: jkim Date: Thu Jun 15 02:39:33 2017 New Revision: 319963 URL: https://svnweb.freebsd.org/changeset/base/319963 Log: Null pointer must be checked before use. This fixes a regression introduced in r318716. Note it is a direct commit to stable/11 because head removed support for idle page zeroing in r305362. PR: 219994 Reviewed by: markj Approved by: re (gjb) Modified: stable/11/sys/vm/vm_page.c Modified: stable/11/sys/vm/vm_page.c ============================================================================== --- stable/11/sys/vm/vm_page.c Thu Jun 15 00:59:02 2017 (r319962) +++ stable/11/sys/vm/vm_page.c Thu Jun 15 02:39:33 2017 (r319963) @@ -1759,18 +1759,18 @@ retry: pagedaemon_wakeup(); return (NULL); } - if (m_ret != NULL) + if (m_ret != NULL) { vm_phys_freecnt_adj(m_ret, -npages); - else { + for (m = m_ret; m < &m_ret[npages]; m++) + if ((m->flags & PG_ZERO) != 0) + vm_page_zero_count--; + } else { #if VM_NRESERVLEVEL > 0 if (vm_reserv_reclaim_contig(npages, low, high, alignment, boundary)) goto retry; #endif } - for (m = m_ret; m < &m_ret[npages]; m++) - if ((m->flags & PG_ZERO) != 0) - vm_page_zero_count--; mtx_unlock(&vm_page_queue_free_mtx); if (m_ret == NULL) return (NULL);