aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChristos Margiolis <christos@FreeBSD.org>2026-04-18 10:33:58 +0000
committerChristos Margiolis <christos@FreeBSD.org>2026-04-23 12:59:52 +0000
commitaba2523261c1e541debe674c059c1ac16210fc04 (patch)
treee86f26c1723dbe36518196c5165e64078dbf4a95
parentfb838352751767e756bd45cd2040fa464ed4de20 (diff)
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
-rw-r--r--sys/dev/sound/pcm/ac97.c3
1 files changed, 1 insertions, 2 deletions
diff --git a/sys/dev/sound/pcm/ac97.c b/sys/dev/sound/pcm/ac97.c
index 73a1e0280e56..1407d202a0d1 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);
}