Bug 261071 - snd_midi: unit 0 cannot have 2 or more channels
Summary: snd_midi: unit 0 cannot have 2 or more channels
Status: New
Alias: None
Product: Base System
Classification: Unclassified
Component: kern (show other bugs)
Version: 13.0-RELEASE
Hardware: Any Any
: --- Affects Only Me
Assignee: freebsd-bugs (Nobody)
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2022-01-10 03:30 UTC by masatic.bsd
Modified: 2022-01-10 03:30 UTC (History)
0 users

See Also:


Attachments
patch, for 13.0-Release-p4 (2.31 KB, patch)
2022-01-10 03:30 UTC, masatic.bsd
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description masatic.bsd 2022-01-10 03:30:28 UTC
Created attachment 230855 [details]
patch, for 13.0-Release-p4

midi_init uses 0 as auto-allocate unit number, but unit 0 is also a valid unit number.
This confliction makes secondary function call to allocate another channel for unit 0 is treated as auto-allocate and returns non-0 unit as result incorrectly.
Attached patch fixes this problem, auto-allocate number is changed from 0 to -1.