summaryrefslogtreecommitdiff
path: root/sys/dev
diff options
context:
space:
mode:
authorriastradh <riastradh@NetBSD.org>2022-04-17 13:17:06 +0000
committerriastradh <riastradh@NetBSD.org>2022-04-17 13:17:06 +0000
commitf821faa5d2254943cb230b35750c9bfaa67d86d7 (patch)
tree9f305d4f32c35189001bf2c352a239038b71aa0c /sys/dev
parent0090bd54d86cb67b82abde4dde060b4246945bbb (diff)
uvideo(4): Convert conditional to KASSERT in uvideo_unit_alloc.
The one caller guarantees the condition already.
Diffstat (limited to 'sys/dev')
-rw-r--r--sys/dev/usb/uvideo.c7
1 files changed, 3 insertions, 4 deletions
diff --git a/sys/dev/usb/uvideo.c b/sys/dev/usb/uvideo.c
index 07c9b7fe5e2..1e8277f8ef0 100644
--- a/sys/dev/usb/uvideo.c
+++ b/sys/dev/usb/uvideo.c
@@ -1,4 +1,4 @@
-/* $NetBSD: uvideo.c,v 1.75 2022/04/17 13:16:11 riastradh Exp $ */
+/* $NetBSD: uvideo.c,v 1.76 2022/04/17 13:17:06 riastradh Exp $ */
/*
* Copyright (c) 2008 Patrick Mahoney
@@ -42,7 +42,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: uvideo.c,v 1.75 2022/04/17 13:16:11 riastradh Exp $");
+__KERNEL_RCSID(0, "$NetBSD: uvideo.c,v 1.76 2022/04/17 13:17:06 riastradh Exp $");
#ifdef _KERNEL_OPT
#include "opt_usb.h"
@@ -870,8 +870,7 @@ uvideo_unit_alloc(const uvideo_descriptor_t *desc)
struct uvideo_unit *vu;
usbd_status err;
- if (desc->bDescriptorType != UDESC_CS_INTERFACE)
- return NULL;
+ KASSERT(desc->bDescriptorType == UDESC_CS_INTERFACE);
vu = kmem_zalloc(sizeof(*vu), KM_SLEEP);
err = uvideo_unit_init(vu, desc);