opnsense-src/sys/dev/sound
Christos Margiolis ad4c8671bd sound: Use unr(9) to produce unique channel unit numbers
Currently it is possible to assign a unit number that already exists.
Suppose the following channel list:

[vp2]

If we create 3 channels, we'll end up with the following list:

[vp0, vp1, vp2, vp2]

This happens because chn_init() does not check if the unit number we are
assigning already exists. While fixing this is trivial when the channel
list is sorted in ascending order, it is way more involved when sorted
in descending order. Even though sorting the list in descending order
would require deliberately modifying pcm_chn_add(), and is most likely
not going to happen, make the mechanism more robust by using a unr(9)
allocator for each channel type.

Sponsored by:	The FreeBSD Foundation
MFC after:	2 days
Reviewed by:	dev_submerge.ch
Differential Revision:	https://reviews.freebsd.org/D46680
2024-10-18 10:39:08 +02:00
..
fdt audio_soc: set "status" as being at simplebus 2024-01-28 13:32:38 +02:00
isa sys: Remove $FreeBSD$: two-line .h pattern 2023-08-16 11:54:11 -06:00
macio sound: Stop checking for failures from malloc(M_WAITOK) 2024-09-03 18:25:33 +08:00
midi sound: drop midistat lock in error path 2024-07-09 11:20:59 -08:00
pci snd_hdsp(4): Support AO4S-192 and AI4S-192 extension boards. 2024-10-04 19:51:49 +01:00
pcm sound: Use unr(9) to produce unique channel unit numbers 2024-10-18 10:39:08 +02:00
usb sound: Stop checking for failures from malloc(M_WAITOK) 2024-09-03 18:25:33 +08:00
driver.c snd_hdsp(4): RME HDSP 9632 and HDSP 9652 sound card driver. 2024-05-09 19:36:40 +01:00
dummy.c sound: Implement dummy driver 2024-07-27 14:54:45 +03:00