Searched hist:ad4c8671bddaa30bf0413089c74dde6a618d9021 (Results 1 – 3 of 3) sorted by relevance
/freebsd/sys/dev/sound/pcm/ |
H A D | sound.h | diff ad4c8671bddaa30bf0413089c74dde6a618d9021 Fri Oct 18 10:39:08 CEST 2024 Christos Margiolis <christos@FreeBSD.org> 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
|
H A D | channel.c | diff ad4c8671bddaa30bf0413089c74dde6a618d9021 Fri Oct 18 10:39:08 CEST 2024 Christos Margiolis <christos@FreeBSD.org> 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
|
H A D | sound.c | diff ad4c8671bddaa30bf0413089c74dde6a618d9021 Fri Oct 18 10:39:08 CEST 2024 Christos Margiolis <christos@FreeBSD.org> 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
|