svn commit: r333842 - head/sys/kern

Matt Macy mmacy at FreeBSD.org
Sat May 19 04:09:59 UTC 2018


Author: mmacy
Date: Sat May 19 04:09:58 2018
New Revision: 333842
URL: https://svnweb.freebsd.org/changeset/base/333842

Log:
  physio: avoid uninitialized variables

Modified:
  head/sys/kern/kern_physio.c

Modified: head/sys/kern/kern_physio.c
==============================================================================
--- head/sys/kern/kern_physio.c	Sat May 19 04:08:11 2018	(r333841)
+++ head/sys/kern/kern_physio.c	Sat May 19 04:09:58 2018	(r333842)
@@ -51,6 +51,8 @@ physio(struct cdev *dev, struct uio *uio, int ioflag)
 	vm_prot_t prot;
 
 	csw = dev->si_devsw;
+	npages = 0;
+	sa = NULL;
 	/* check if character device is being destroyed */
 	if (csw == NULL)
 		return (ENXIO);
@@ -177,7 +179,7 @@ physio(struct cdev *dev, struct uio *uio, int ioflag)
 					error = EFAULT;
 					goto doerror;
 				}
-				if (pbuf) {
+				if (pbuf && sa) {
 					pmap_qenter((vm_offset_t)sa,
 					    pages, npages);
 					bp->bio_data = sa + poff;


More information about the svn-src-head mailing list