Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/trunk]: src/sys/dev/usb Use kmem_zalloc() instead of kmem_alloc() to ini...
details: https://anonhg.NetBSD.org/src/rev/f730bfb7b006
branches: trunk
changeset: 460793:f730bfb7b006
user: isaki <isaki%NetBSD.org@localhost>
date: Mon Nov 04 05:46:39 2019 +0000
description:
Use kmem_zalloc() instead of kmem_alloc() to initialize structure.
struct audio_format added a member since isaki-audio2.
Fix PR kern/54662 "uaudio sometimes not recognized".
diffstat:
sys/dev/usb/uaudio.c | 7 +++----
1 files changed, 3 insertions(+), 4 deletions(-)
diffs (33 lines):
diff -r 6d39557fccc0 -r f730bfb7b006 sys/dev/usb/uaudio.c
--- a/sys/dev/usb/uaudio.c Mon Nov 04 00:59:05 2019 +0000
+++ b/sys/dev/usb/uaudio.c Mon Nov 04 05:46:39 2019 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: uaudio.c,v 1.161 2019/06/06 12:59:33 isaki Exp $ */
+/* $NetBSD: uaudio.c,v 1.162 2019/11/04 05:46:39 isaki Exp $ */
/*
* Copyright (c) 1999, 2012 The NetBSD Foundation, Inc.
@@ -37,7 +37,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: uaudio.c,v 1.161 2019/06/06 12:59:33 isaki Exp $");
+__KERNEL_RCSID(0, "$NetBSD: uaudio.c,v 1.162 2019/11/04 05:46:39 isaki Exp $");
#ifdef _KERNEL_OPT
#include "opt_usb.h"
@@ -1795,13 +1795,12 @@
}
/* build audio_format array */
- sc->sc_formats = kmem_alloc(sizeof(struct audio_format) * sc->sc_nalts,
+ sc->sc_formats = kmem_zalloc(sizeof(struct audio_format) * sc->sc_nalts,
KM_SLEEP);
sc->sc_nformats = sc->sc_nalts;
for (i = 0; i < sc->sc_nalts; i++) {
auf = &sc->sc_formats[i];
t1desc = sc->sc_alts[i].asf1desc;
- auf->driver_data = NULL;
if (UE_GET_DIR(sc->sc_alts[i].edesc->bEndpointAddress) == UE_DIR_OUT)
auf->mode = AUMODE_PLAY;
else
Home |
Main Index |
Thread Index |
Old Index