1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-27 16:27:35 +00:00

Kernel: Allow writes larger than PAGE_SIZE to AC97 device

Previously, `cat /dev/random > /dev/audio` would crash Serenity. Fix
this by splitting up the written data into `PAGE_SIZE` chunks.
This commit is contained in:
Jelle Raaijmakers 2021-11-23 12:49:37 +01:00 committed by Andreas Kling
parent 70ca8b24dc
commit eb2b0d847e
2 changed files with 18 additions and 6 deletions

View file

@ -152,6 +152,7 @@ private:
void set_master_output_volume(u8, u8, Muted);
void set_pcm_output_sample_rate(u16);
void set_pcm_output_volume(u8, u8, Muted);
ErrorOr<void> write_single_buffer(UserOrKernelBuffer const&, size_t, size_t);
OwnPtr<Memory::Region> m_buffer_descriptor_list;
u8 m_buffer_descriptor_list_index = 0;