Date: Thu, 15 Jun 2017 02:39:33 +0000 (UTC) From: Jung-uk Kim <jkim@FreeBSD.org> 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 Message-ID: <201706150239.v5F2dXSc017461@repo.freebsd.org>
next in thread | raw e-mail | index | archive | help
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);
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201706150239.v5F2dXSc017461>