summaryrefslogtreecommitdiffstats
path: root/sys/dev
diff options
context:
space:
mode:
authormiod <miod@openbsd.org>2006-12-30 19:15:30 +0000
committermiod <miod@openbsd.org>2006-12-30 19:15:30 +0000
commit57be4ef357100aec2494092f7a77a10d59f12c39 (patch)
tree37615dccdb8f1d57e2013b2b80f7cc0f4a9e72fd /sys/dev
parentIn agp_i810_alloc_memory(), do not check for sc_maxmem limit reached, as the (diff)
downloadwireguard-openbsd-57be4ef357100aec2494092f7a77a10d59f12c39.tar.xz
wireguard-openbsd-57be4ef357100aec2494092f7a77a10d59f12c39.zip
In agp_generic_alloc_memory(), make sure the age_mem structure freshly
malloc'ed is completely bzeroed before use. ok deraadt@
Diffstat (limited to 'sys/dev')
-rw-r--r--sys/dev/pci/agp.c7
1 files changed, 2 insertions, 5 deletions
diff --git a/sys/dev/pci/agp.c b/sys/dev/pci/agp.c
index 776aab76f1a..91d764a933f 100644
--- a/sys/dev/pci/agp.c
+++ b/sys/dev/pci/agp.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: agp.c,v 1.1 2006/03/16 21:32:34 matthieu Exp $ */
+/* $OpenBSD: agp.c,v 1.2 2006/12/30 19:15:30 miod Exp $ */
/*-
* Copyright (c) 2000 Doug Rabson
* All rights reserved.
@@ -474,6 +474,7 @@ agp_generic_alloc_memory(struct vga_pci_softc *sc, int type, vsize_t size)
mem = malloc(sizeof *mem, M_DEVBUF, M_WAITOK);
if (mem == NULL)
return NULL;
+ bzero(mem, sizeof *mem);
if (bus_dmamap_create(sc->sc_dmat, size, size / PAGE_SIZE + 1,
size, 0, BUS_DMA_NOWAIT, &mem->am_dmamap) != 0) {
@@ -483,10 +484,6 @@ agp_generic_alloc_memory(struct vga_pci_softc *sc, int type, vsize_t size)
mem->am_id = sc->sc_nextid++;
mem->am_size = size;
- mem->am_type = 0;
- mem->am_physical = 0;
- mem->am_offset = 0;
- mem->am_is_bound = 0;
TAILQ_INSERT_TAIL(&sc->sc_memory, mem, am_link);
sc->sc_allocated += size;