diff options
author | Charles Longeau <chl@cvs.openbsd.org> | 2007-11-28 16:25:59 +0000 |
---|---|---|
committer | Charles Longeau <chl@cvs.openbsd.org> | 2007-11-28 16:25:59 +0000 |
commit | 71308e3d374fa32bae4bcd2238c7892433028b79 (patch) | |
tree | 0bb04acc51c7561935932e65bbef31e31e20ccb2 /sys | |
parent | 918449653e5e0fcd61546ce050b00c55e5ce3c34 (diff) |
do not check malloc return value against NULL, as M_WAITOK is used
ok oga@
Diffstat (limited to 'sys')
-rw-r--r-- | sys/dev/pci/agp.c | 10 | ||||
-rw-r--r-- | sys/dev/pci/agp_i810.c | 6 |
2 files changed, 2 insertions, 14 deletions
diff --git a/sys/dev/pci/agp.c b/sys/dev/pci/agp.c index dec6f753e09..7a073bc3771 100644 --- a/sys/dev/pci/agp.c +++ b/sys/dev/pci/agp.c @@ -1,4 +1,4 @@ -/* $OpenBSD: agp.c,v 1.10 2007/11/26 15:35:15 deraadt Exp $ */ +/* $OpenBSD: agp.c,v 1.11 2007/11/28 16:25:58 chl Exp $ */ /*- * Copyright (c) 2000 Doug Rabson * All rights reserved. @@ -474,8 +474,6 @@ agp_generic_alloc_memory(struct agp_softc *sc, int type, vsize_t size) } mem = malloc(sizeof *mem, M_AGP, M_WAITOK | M_ZERO); - if (mem == NULL) - return (NULL); if (bus_dmamap_create(sc->sc_dmat, size, size / PAGE_SIZE + 1, size, 0, BUS_DMA_NOWAIT, &mem->am_dmamap) != 0) { @@ -540,12 +538,6 @@ agp_generic_bind_memory(struct agp_softc *sc, struct agp_memory *mem, nseg = (mem->am_size + PAGE_SIZE - 1) / PAGE_SIZE; segs = malloc(nseg * sizeof *segs, M_AGP, M_WAITOK); - if (segs == NULL) { - lockmgr(&sc->sc_lock, LK_RELEASE, NULL); - AGP_DPF("malloc segs (%u) failed\n", - nseg * sizeof *segs); - return (ENOMEM); - } if ((error = bus_dmamem_alloc(sc->sc_dmat, mem->am_size, PAGE_SIZE, 0, segs, nseg, &mem->am_nseg, BUS_DMA_WAITOK)) != 0) { free(segs, M_AGP); diff --git a/sys/dev/pci/agp_i810.c b/sys/dev/pci/agp_i810.c index 7b28b46382e..5f932e2a822 100644 --- a/sys/dev/pci/agp_i810.c +++ b/sys/dev/pci/agp_i810.c @@ -1,4 +1,4 @@ -/* $OpenBSD: agp_i810.c,v 1.21 2007/11/26 15:35:15 deraadt Exp $ */ +/* $OpenBSD: agp_i810.c,v 1.22 2007/11/28 16:25:58 chl Exp $ */ /* $NetBSD: agp_i810.c,v 1.15 2003/01/31 00:07:39 thorpej Exp $ */ /*- @@ -717,10 +717,6 @@ agp_i810_alloc_memory(struct agp_softc *sc, int type, vsize_t size) */ mem->am_dmaseg = malloc(sizeof *mem->am_dmaseg, M_AGP, M_WAITOK); - if (mem->am_dmaseg == NULL) { - free(mem, M_AGP); - return (NULL); - } if ((error = agp_alloc_dmamem(sc->sc_dmat, size, 0, &mem->am_dmamap, &mem->am_virtual, &mem->am_physical, mem->am_dmaseg, 1, &mem->am_nseg)) != 0) { |