Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/sys/dev/usb usb(4): kmem_zalloc(KM_SLEEP) cannot fail; nix e...



details:   https://anonhg.NetBSD.org/src/rev/9a4c1d2e0f12
branches:  trunk
changeset: 379606:9a4c1d2e0f12
user:      riastradh <riastradh%NetBSD.org@localhost>
date:      Sat Jun 12 12:11:11 2021 +0000

description:
usb(4): kmem_zalloc(KM_SLEEP) cannot fail; nix error branch.

diffstat:

 sys/dev/usb/usb_subr.c |  6 ++----
 1 files changed, 2 insertions(+), 4 deletions(-)

diffs (27 lines):

diff -r d0557febee84 -r 9a4c1d2e0f12 sys/dev/usb/usb_subr.c
--- a/sys/dev/usb/usb_subr.c    Sat Jun 12 12:11:01 2021 +0000
+++ b/sys/dev/usb/usb_subr.c    Sat Jun 12 12:11:11 2021 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: usb_subr.c,v 1.250 2021/04/24 23:36:59 thorpej Exp $   */
+/*     $NetBSD: usb_subr.c,v 1.251 2021/06/12 12:11:11 riastradh Exp $ */
 /*     $FreeBSD: src/sys/dev/usb/usb_subr.c,v 1.18 1999/11/17 22:33:47 n_hibma Exp $   */
 
 /*
@@ -32,7 +32,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: usb_subr.c,v 1.250 2021/04/24 23:36:59 thorpej Exp $");
+__KERNEL_RCSID(0, "$NetBSD: usb_subr.c,v 1.251 2021/06/12 12:11:11 riastradh Exp $");
 
 #ifdef _KERNEL_OPT
 #include "opt_compat_netbsd.h"
@@ -1068,8 +1068,6 @@ usbd_probe_and_attach(device_t parent, s
                nifaces = dev->ud_cdesc->bNumInterface;
                dev->ud_subdevs = kmem_zalloc(nifaces * sizeof(device_t),
                    KM_SLEEP);
-               if (dev->ud_subdevs == NULL)
-                       return USBD_NOMEM;
                dev->ud_subdevlen = nifaces;
 
                err = usbd_attachinterfaces(parent, dev, port, NULL);



Home | Main Index | Thread Index | Old Index