From f32deff7f6634ed1bd37fbda4fff9fcc34c4106b Mon Sep 17 00:00:00 2001 From: RichardG867 Date: Fri, 19 Nov 2021 15:56:21 -0300 Subject: [PATCH] snd_ac97_codec: Fix fatal and crash caused by AMR card spill-over --- src/sound/snd_ac97_codec.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/sound/snd_ac97_codec.c b/src/sound/snd_ac97_codec.c index b992b0e6a..ac19cdd7b 100644 --- a/src/sound/snd_ac97_codec.c +++ b/src/sound/snd_ac97_codec.c @@ -542,7 +542,7 @@ ac97_codec_init(const device_t *info) /* Associate this codec to the current controller. */ if (!ac97_codec || (ac97_codec_count <= 0)) { - fatal("AC97 Codec %d: No controller to associate codec\n", ac97_codec_id); + pclog("AC97 Codec %d: No controller to associate codec\n", ac97_codec_id); return NULL; } *ac97_codec = dev; @@ -583,6 +583,8 @@ static void ac97_codec_close(void *priv) { ac97_codec_t *dev = (ac97_codec_t *) priv; + if (!dev) + return; ac97_codec_log("AC97 Codec %d: close()\n", dev->codec_id);