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
This commit is contained in:
parent
2154a866b6
commit
8d2a55ca67
@ -177,6 +177,7 @@ nvdimm_spa_uio(struct nvdimm_spa_dev *dev, struct uio *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, struct bio *bp, int rw)
|
||||
|
||||
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];
|
||||
|
@ -689,7 +689,7 @@ dmar_bus_dmamap_load_phys(bus_dma_tag_t dmat, bus_dmamap_t map1,
|
||||
*/
|
||||
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_dmamap_t map1, void *buf,
|
||||
*/
|
||||
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);
|
||||
|
Loading…
x
Reference in New Issue
Block a user