summaryrefslogtreecommitdiff
path: root/sys/dev/usb
diff options
context:
space:
mode:
authormmcc <mmcc@cvs.openbsd.org>2015-12-18 17:23:15 +0000
committermmcc <mmcc@cvs.openbsd.org>2015-12-18 17:23:15 +0000
commit0b0d6477c446d4d78d04aa8a147e743bac7f6dfd (patch)
treef5c2e59d95b73441babb7c62e5008a86e6cd6933 /sys/dev/usb
parent621123e5630fee6832fe5d8ebb8ce1d57fa83bc1 (diff)
Remove two error-on-NULL conditions for allocations that can't fail.
ok visa@
Diffstat (limited to 'sys/dev/usb')
-rw-r--r--sys/dev/usb/dwc2/dwc2.c6
-rw-r--r--sys/dev/usb/dwc2/dwc2_hcdddma.c7
2 files changed, 2 insertions, 11 deletions
diff --git a/sys/dev/usb/dwc2/dwc2.c b/sys/dev/usb/dwc2/dwc2.c
index da908d9ff13..fc5dbbbe3f7 100644
--- a/sys/dev/usb/dwc2/dwc2.c
+++ b/sys/dev/usb/dwc2/dwc2.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: dwc2.c,v 1.34 2015/09/03 15:14:08 visa Exp $ */
+/* $OpenBSD: dwc2.c,v 1.35 2015/12/18 17:23:14 mmcc Exp $ */
/* $NetBSD: dwc2.c,v 1.32 2014/09/02 23:26:20 macallan Exp $ */
/*-
@@ -1575,10 +1575,6 @@ dwc2_init(struct dwc2_softc *sc)
sc->sc_hsotg = malloc(sizeof(struct dwc2_hsotg), M_DEVBUF,
M_ZERO | M_WAITOK);
- if (sc->sc_hsotg == NULL) {
- err = ENOMEM;
- goto fail1;
- }
sc->sc_hsotg->hsotg_sc = sc;
sc->sc_hsotg->dev = &sc->sc_bus.bdev;
diff --git a/sys/dev/usb/dwc2/dwc2_hcdddma.c b/sys/dev/usb/dwc2/dwc2_hcdddma.c
index ec071309ad7..d20647f8c7b 100644
--- a/sys/dev/usb/dwc2/dwc2_hcdddma.c
+++ b/sys/dev/usb/dwc2/dwc2_hcdddma.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: dwc2_hcdddma.c,v 1.10 2015/06/28 11:48:18 jmatthew Exp $ */
+/* $OpenBSD: dwc2_hcdddma.c,v 1.11 2015/12/18 17:23:14 mmcc Exp $ */
/* $NetBSD: dwc2_hcdddma.c,v 1.6 2014/04/03 06:34:58 skrll Exp $ */
/*
@@ -124,11 +124,6 @@ STATIC int dwc2_desc_list_alloc(struct dwc2_hsotg *hsotg, struct dwc2_qh *qh,
qh->n_bytes = malloc(sizeof(u32) * dwc2_max_desc_num(qh), M_DEVBUF,
M_ZERO | M_WAITOK);
- if (!qh->n_bytes) {
- usb_freemem(&hsotg->hsotg_sc->sc_bus, &qh->desc_list_usbdma);
- qh->desc_list = NULL;
- return -ENOMEM;
- }
return 0;
}