Module Name: src Committed By: riastradh Date: Sun Apr 17 13:17:06 UTC 2022
Modified Files: src/sys/dev/usb: uvideo.c Log Message: uvideo(4): Convert conditional to KASSERT in uvideo_unit_alloc. The one caller guarantees the condition already. To generate a diff of this commit: cvs rdiff -u -r1.75 -r1.76 src/sys/dev/usb/uvideo.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/usb/uvideo.c diff -u src/sys/dev/usb/uvideo.c:1.75 src/sys/dev/usb/uvideo.c:1.76 --- src/sys/dev/usb/uvideo.c:1.75 Sun Apr 17 13:16:11 2022 +++ src/sys/dev/usb/uvideo.c Sun Apr 17 13:17:06 2022 @@ -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_descripto 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);