Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/trunk]: src/sys/dev/usb uvideo(4): Use kmem_zalloc, not kmem_alloc and m...
details: https://anonhg.NetBSD.org/src/rev/4f7cc10ea2cb
branches: trunk
changeset: 363438:4f7cc10ea2cb
user: riastradh <riastradh%NetBSD.org@localhost>
date: Sat Mar 12 16:51:10 2022 +0000
description:
uvideo(4): Use kmem_zalloc, not kmem_alloc and memset.
diffstat:
sys/dev/usb/uvideo.c | 8 +++-----
1 files changed, 3 insertions(+), 5 deletions(-)
diffs (36 lines):
diff -r c1a160e5fc82 -r 4f7cc10ea2cb sys/dev/usb/uvideo.c
--- a/sys/dev/usb/uvideo.c Sat Mar 12 16:46:57 2022 +0000
+++ b/sys/dev/usb/uvideo.c Sat Mar 12 16:51:10 2022 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: uvideo.c,v 1.69 2022/03/03 06:23:25 riastradh Exp $ */
+/* $NetBSD: uvideo.c,v 1.70 2022/03/12 16:51:10 riastradh Exp $ */
/*
* Copyright (c) 2008 Patrick Mahoney
@@ -42,7 +42,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: uvideo.c,v 1.69 2022/03/03 06:23:25 riastradh Exp $");
+__KERNEL_RCSID(0, "$NetBSD: uvideo.c,v 1.70 2022/03/12 16:51:10 riastradh Exp $");
#ifdef _KERNEL_OPT
#include "opt_usb.h"
@@ -851,7 +851,7 @@
if (desc->bDescriptorType != UDESC_CS_INTERFACE)
return NULL;
- vu = kmem_alloc(sizeof(*vu), KM_SLEEP);
+ vu = kmem_zalloc(sizeof(*vu), KM_SLEEP);
err = uvideo_unit_init(vu, desc);
if (err != USBD_NORMAL_COMPLETION) {
DPRINTF(("uvideo_unit_alloc: error initializing unit: "
@@ -875,8 +875,6 @@
const uvideo_processing_unit_descriptor_t *processing;
const uvideo_extension_unit_descriptor_t *extension;
- memset(vu, 0, sizeof(*vu));
-
switch (desc->bDescriptorSubtype) {
case UDESC_INPUT_TERMINAL:
if (desc->bLength < sizeof(*input))
Home |
Main Index |
Thread Index |
Old Index