HomeFreeBSD

sound: Add missing CHN_[UN]LOCKs in sndstat

Description

sound: Add missing CHN_[UN]LOCKs in sndstat

In sndstat_build_sound4_nvlist(), if we have INVARIANTS or
SND_DIAGNOSTIC enabled, we will hit a lock assertion panic when we call
CHN_GETVOLUME(). Also lock the channel in the sndstat_prepare_pcm() loop
for good measure.

Fixes: bbca3a75bb41 ("sound: Include sound(4) channel information in sndstat nvlist")
Sponsored by: The FreeBSD Foundation
MFC after: 2 days
Reviewed by: dev_submerge.ch
Differential Revision: https://reviews.freebsd.org/D45898

(cherry picked from commit e850bd36dfda98608432d2459800627d16119fec)

Details

Provenance
christosAuthored on Jul 6 2024, 6:23 PM
Reviewer
dev_submerge.ch
Differential Revision
D45898: sound: Add missing CHN_[UN]LOCKs in sndstat
Parents
rGefaa4bcc9283: sound: Add min_rate and min_channels safety check in SNDCTL_AUDIOINFO
Branches
Unknown
Tags
Unknown