From: kevlo Date: Mon, 9 Aug 2021 12:59:53 +0000 (+0000) Subject: If an error during attach caused us to detach our resources, X-Git-Url: http://artulab.com/gitweb/?a=commitdiff_plain;h=b52bff80cab51c4fa842580fba2bca01f091147b;p=openbsd If an error during attach caused us to detach our resources, don't do anything on shutdown. This fixes a panic that was reported by me on X1 Extreme Gen 1. ok ratchov@ --- diff --git a/sys/dev/pci/azalia.c b/sys/dev/pci/azalia.c index 94c7efe30fc..81626e0cf44 100644 --- a/sys/dev/pci/azalia.c +++ b/sys/dev/pci/azalia.c @@ -1,4 +1,4 @@ -/* $OpenBSD: azalia.c,v 1.263 2021/06/11 15:46:09 jsg Exp $ */ +/* $OpenBSD: azalia.c,v 1.264 2021/08/09 12:59:53 kevlo Exp $ */ /* $NetBSD: azalia.c,v 1.20 2006/05/07 08:31:44 kent Exp $ */ /*- @@ -738,6 +738,9 @@ azalia_shutdown(void *v) azalia_t *az = (azalia_t *)v; uint32_t gctl; + if (az->detached) + return; + /* disable unsolicited response */ gctl = AZ_READ_4(az, GCTL); AZ_WRITE_4(az, GCTL, gctl & ~(HDA_GCTL_UNSOL));