From aba2523261c1e541debe674c059c1ac16210fc04 Mon Sep 17 00:00:00 2001 From: Christos Margiolis Date: Sat, 18 Apr 2026 12:33:58 +0200 Subject: [PATCH] sound: Do not check for NULL before deleting ac97_info->methods It is allocated with M_WAITOK in ac97_create(). Sponsored by: The FreeBSD Foundation MFC after: 1 week Pull Request: https://ron-dev.freebsd.org/FreeBSD/src/pulls/17 --- sys/dev/sound/pcm/ac97.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/sys/dev/sound/pcm/ac97.c b/sys/dev/sound/pcm/ac97.c index 73a1e0280e5..1407d202a0d 100644 --- a/sys/dev/sound/pcm/ac97.c +++ b/sys/dev/sound/pcm/ac97.c @@ -835,8 +835,7 @@ void ac97_destroy(struct ac97_info *codec) { mtx_lock(&codec->lock); - if (codec->methods != NULL) - kobj_delete(codec->methods, M_AC97); + kobj_delete(codec->methods, M_AC97); mtx_destroy(&codec->lock); free(codec, M_AC97); }