Page MenuHomeFreeBSD

mixer: Fix default_unit switching with mixers that have no devices
ClosedPublic

Authored by markj on Jan 15 2023, 2:30 PM.
Tags
None
Referenced Files
F107300392: D38060.diff
Sun, Jan 12, 5:14 AM
Unknown Object (File)
Dec 2 2024, 1:59 PM
Unknown Object (File)
Dec 2 2024, 1:46 PM
Unknown Object (File)
Oct 26 2024, 2:01 PM
Unknown Object (File)
Sep 24 2024, 4:07 AM
Unknown Object (File)
Sep 18 2024, 3:25 AM
Unknown Object (File)
Sep 17 2024, 7:12 PM
Unknown Object (File)
Sep 16 2024, 11:22 PM
Subscribers

Details

Summary

Apparently it's possible for a mixer to have no devices:

$ mixer -f /dev/mixer2
pcm2:mixer: <USB audio> at ? kld snd_uaudio (rec)

If this is the default sound device, an attempt to change the default
unit using mixer -d fails with a segfault because mod_dunit is called
with a NULL device pointer, which is dereferenced to get the parent
mixer.

ctl_dunit seems to be a dummy, i.e., we don't actually need it and can
simply pass the mixer to mod_dunit() directly. This patch removes that
structure and associated indirection to fix the crash.

Diff Detail

Repository
rG FreeBSD src repository
Lint
Lint Skipped
Unit
Tests Skipped
Build Status
Buildable 49110
Build 45999: arc lint + arc unit