Module Name: src
Committed By: maxv
Date: Sun Aug 20 10:55:37 UTC 2017
Modified Files:
src/sys/dev/pci: oboe.c
Log Message:
M_WAITOK cannot fail, so remove the test branches. Otherwise it looks
like leak/uninitialized area.
To generate a diff of this commit:
cvs rdiff -u -r1.43 -r1.44 src/sys/dev/pci/oboe.c
Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.
Modified files:
Index: src/sys/dev/pci/oboe.c
diff -u src/sys/dev/pci/oboe.c:1.43 src/sys/dev/pci/oboe.c:1.44
--- src/sys/dev/pci/oboe.c:1.43 Fri Jul 24 06:17:10 2015
+++ src/sys/dev/pci/oboe.c Sun Aug 20 10:55:37 2017
@@ -1,4 +1,4 @@
-/* $NetBSD: oboe.c,v 1.43 2015/07/24 06:17:10 martin Exp $ */
+/* $NetBSD: oboe.c,v 1.44 2017/08/20 10:55:37 maxv Exp $ */
/* XXXXFVDL THIS DRIVER IS BROKEN FOR NON-i386 -- vtophys() usage */
@@ -38,7 +38,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: oboe.c,v 1.43 2015/07/24 06:17:10 martin Exp $");
+__KERNEL_RCSID(0, "$NetBSD: oboe.c,v 1.44 2017/08/20 10:55:37 maxv Exp $");
#include <sys/param.h>
#include <sys/systm.h>
@@ -641,9 +641,7 @@ oboe_alloc_taskfile(struct oboe_softc *s
/* XXX */
uintptr_t addr =
(uintptr_t)malloc(OBOE_TASK_BUF_LEN, M_DEVBUF, M_WAITOK);
- if (addr == 0) {
- goto bad;
- }
+
addr &= ~(sizeof (struct OboeTaskFile) - 1);
addr += sizeof (struct OboeTaskFile);
sc->sc_taskfile = (struct OboeTaskFile *) addr;
@@ -653,26 +651,15 @@ oboe_alloc_taskfile(struct oboe_softc *s
malloc(TX_BUF_SZ, M_DEVBUF, M_WAITOK);
sc->sc_xmit_stores[i] =
malloc(TX_BUF_SZ, M_DEVBUF, M_WAITOK);
- if (sc->sc_xmit_bufs[i] == NULL ||
- sc->sc_xmit_stores[i] == NULL) {
- goto bad;
- }
}
for (i = 0; i < RX_SLOTS; ++i) {
sc->sc_recv_bufs[i] =
malloc(RX_BUF_SZ, M_DEVBUF, M_WAITOK);
sc->sc_recv_stores[i] =
malloc(RX_BUF_SZ, M_DEVBUF, M_WAITOK);
- if (sc->sc_recv_bufs[i] == NULL ||
- sc->sc_recv_stores[i] == NULL) {
- goto bad;
- }
}
return 0;
-bad:
- printf("oboe: malloc for buffers failed()\n");
- return 1;
}
static void