Kernel/Audio: Ignore buffers with more than 4096 bytes of data in SB16

The SB16 card driver doesn't swallow more than 4096 bytes of data at
once, so instead of asserting just return ENOSPC for now.

To test this, either play normal sound or just this (very!) loud noise:

dd if=/dev/random of=/dev/audio/0 bs=4096
This commit is contained in:
Liav A 2022-02-11 22:31:18 +02:00 committed by Andreas Kling
parent bf8c93fe0a
commit 10178dc939
Notes: sideshowbarker 2024-07-17 18:51:36 +09:00

View File

@ -252,9 +252,7 @@ ErrorOr<size_t> SB16::write(size_t channel_index, UserOrKernelBuffer const& data
dbgln_if(SB16_DEBUG, "SB16: Writing buffer of {} bytes", length);
VERIFY(length <= PAGE_SIZE);
int const BLOCK_SIZE = 32 * 1024;
if (length > BLOCK_SIZE) {
if (length > PAGE_SIZE) {
return ENOSPC;
}