Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 12 Mar 2014 16:38:56 +0000 (UTC)
From:      Konstantin Belousov <kib@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r263095 - head/sys/vm
Message-ID:  <201403121638.s2CGcu25091517@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: kib
Date: Wed Mar 12 16:38:55 2014
New Revision: 263095
URL: http://svnweb.freebsd.org/changeset/base/263095

Log:
  Initialize paddr to handle the case of zero size.
  
  Reported and reviewed by:	Conrad Meyer <cemeyer@uw.edu>
  MFC after:	1 week

Modified:
  head/sys/vm/device_pager.c

Modified: head/sys/vm/device_pager.c
==============================================================================
--- head/sys/vm/device_pager.c	Wed Mar 12 15:30:40 2014	(r263094)
+++ head/sys/vm/device_pager.c	Wed Mar 12 16:38:55 2014	(r263095)
@@ -414,6 +414,7 @@ old_dev_pager_ctor(void *handle, vm_ooff
 	 * XXX assumes VM_PROT_* == PROT_*
 	 */
 	npages = OFF_TO_IDX(size);
+	paddr = 0; /* Make paddr initialized for the case of size == 0. */
 	for (off = foff; npages--; off += PAGE_SIZE) {
 		if (csw->d_mmap(dev, off, &paddr, (int)prot, &dummy) != 0) {
 			dev_relthread(dev, ref);



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