From 10178dc939ace09ca1d5e4c007d1c6b0038cfeff Mon Sep 17 00:00:00 2001 From: Liav A Date: Fri, 11 Feb 2022 22:31:18 +0200 Subject: [PATCH] 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 --- Kernel/Devices/Audio/SB16.cpp | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/Kernel/Devices/Audio/SB16.cpp b/Kernel/Devices/Audio/SB16.cpp index 2d23118538..65036ccebf 100644 --- a/Kernel/Devices/Audio/SB16.cpp +++ b/Kernel/Devices/Audio/SB16.cpp @@ -252,9 +252,7 @@ ErrorOr 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; }