svn commit: r347168 - in head/sys: dev/nvdimm x86/iommu
Tycho Nightingale
tychon at FreeBSD.org
Mon May 6 00:57:06 UTC 2019
Author: tychon
Date: Mon May 6 00:57:05 2019
New Revision: 347168
URL: https://svnweb.freebsd.org/changeset/base/347168
Log:
zero inputs to vm_page_initfake() for predictable results
Reviewed by: kib
Submitted by: Anton Rang <rang at acm.org>
Sponsored by: Dell EMC Isilon
Differential Revision: https://reviews.freebsd.org/D20162
Modified:
head/sys/dev/nvdimm/nvdimm_spa.c
head/sys/x86/iommu/busdma_dmar.c
Modified: head/sys/dev/nvdimm/nvdimm_spa.c
==============================================================================
--- head/sys/dev/nvdimm/nvdimm_spa.c Sun May 5 20:23:43 2019 (r347167)
+++ head/sys/dev/nvdimm/nvdimm_spa.c Mon May 6 00:57:05 2019 (r347168)
@@ -177,6 +177,7 @@ nvdimm_spa_uio(struct nvdimm_spa_dev *dev, struct uio
error = 0;
if (dev->spa_kva == NULL) {
mattr = nvdimm_spa_memattr(dev);
+ bzero(&m, sizeof(m));
vm_page_initfake(&m, 0, mattr);
ma = &m;
while (uio->uio_resid > 0) {
@@ -276,7 +277,7 @@ nvdimm_spa_g_all_unmapped(struct nvdimm_spa_dev *dev,
mattr = nvdimm_spa_memattr(dev);
for (i = 0; i < nitems(ma); i++) {
- maa[i].flags = 0;
+ bzero(&maa[i], sizeof(maa[i]));
vm_page_initfake(&maa[i], dev->spa_phys_base +
trunc_page(bp->bio_offset) + PAGE_SIZE * i, mattr);
ma[i] = &maa[i];
Modified: head/sys/x86/iommu/busdma_dmar.c
==============================================================================
--- head/sys/x86/iommu/busdma_dmar.c Sun May 5 20:23:43 2019 (r347167)
+++ head/sys/x86/iommu/busdma_dmar.c Mon May 6 00:57:05 2019 (r347168)
@@ -689,7 +689,7 @@ dmar_bus_dmamap_load_phys(bus_dma_tag_t dmat, bus_dmam
*/
if (fma == NULL) {
fma = malloc(sizeof(struct vm_page) * ma_cnt,
- M_DEVBUF, mflags);
+ M_DEVBUF, M_ZERO | mflags);
if (fma == NULL) {
free(ma, M_DEVBUF);
return (ENOMEM);
@@ -743,7 +743,7 @@ dmar_bus_dmamap_load_buffer(bus_dma_tag_t dmat, bus_dm
*/
if (fma == NULL) {
fma = malloc(sizeof(struct vm_page) * ma_cnt,
- M_DEVBUF, mflags);
+ M_DEVBUF, M_ZERO | mflags);
if (fma == NULL) {
free(ma, M_DEVBUF);
return (ENOMEM);
More information about the svn-src-all
mailing list