Source-Changes-HG archive

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

[src/trunk]: src/sys/dev/acpi Fix KASSERT triggered when attaching opl at wss.



details:   https://anonhg.NetBSD.org/src/rev/28b5a4301190
branches:  trunk
changeset: 1023994:28b5a4301190
user:      uwe <uwe%NetBSD.org@localhost>
date:      Wed Oct 06 18:41:34 2021 +0000

description:
Fix KASSERT triggered when attaching opl at wss.

wss has two attributes, "wss" and "audiobus", and this call didn't
specify an iattr for opl to attach to.  config_search_internal asserts
that when no iattr is specified, the parent should only have one.

The same problem probably exists for other wss attachments, as opl is
not attached from wssattach, but from each wss_*_attach, so they need
a similar change.

diffstat:

 sys/dev/acpi/wss_acpi.c |  6 +++---
 1 files changed, 3 insertions(+), 3 deletions(-)

diffs (27 lines):

diff -r eabc2a5c28f9 -r 28b5a4301190 sys/dev/acpi/wss_acpi.c
--- a/sys/dev/acpi/wss_acpi.c   Wed Oct 06 17:04:49 2021 +0000
+++ b/sys/dev/acpi/wss_acpi.c   Wed Oct 06 18:41:34 2021 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: wss_acpi.c,v 1.35 2021/08/07 16:19:09 thorpej Exp $ */
+/* $NetBSD: wss_acpi.c,v 1.36 2021/10/06 18:41:34 uwe Exp $ */
 
 /*
  * Copyright (c) 2002 Jared D. McNeill <jmcneill%invisible.ca@localhost>
@@ -26,7 +26,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: wss_acpi.c,v 1.35 2021/08/07 16:19:09 thorpej Exp $");
+__KERNEL_RCSID(0, "$NetBSD: wss_acpi.c,v 1.36 2021/10/06 18:41:34 uwe Exp $");
 
 #include <sys/param.h>
 #include <sys/audioio.h>
@@ -187,7 +187,7 @@
        arg.type = AUDIODEV_TYPE_OPL;
        arg.hwif = 0;
        arg.hdl = 0;
-       config_found(self, &arg, audioprint, CFARGS_NONE);
+       config_found(self, &arg, audioprint, CFARGS(.iattr = "wss"));
 
  out:
        acpi_resource_cleanup(&res);



Home | Main Index | Thread Index | Old Index