[Bug 262671] Kernel panics after a invalid SNDCTL_MIXERINFO ioctl

From: <bugzilla-noreply_at_freebsd.org>
Date: Sun, 20 Mar 2022 09:37:09 UTC
https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=262671

--- Comment #7 from Aleksander Slomka <alex@alexslomka.xyz> ---
OK, I think I know what's going on. So It looks like in my case
`devclass_get_maxunit` is returning a bigger value than the actual number of
devices. That's why on the 4th iteration of the `for` loop `devclass_get_softc`
returns `NULL` (I do not have a mixer device with the unit number 4)

`mixer -a` returns this:

pcm0:mixer: <Realtek ALC892 (Rear Analog 7.1/2.0)> on hdaa0  (play/rec)
(default)
    ...
pcm1:mixer: <Realtek ALC892 (Front Analog)> on hdaa0  (play/rec)
    ...
pcm2:mixer: <Realtek ALC892 (Onboard Digital)> on hdaa0  (play)
    ...
pcm3:mixer: <Intel Kaby Lake (HDMI/DP 8ch)> on hdaa1  (play)
    ...

The highest unit number here is 3, but when I checked in kgdb
`devclass_get_maxunit(pcm_devclass)` returns the value `5`.

-- 
You are receiving this mail because:
You are the assignee for the bug.