mirror of
https://github.com/torvalds/linux.git
synced 2026-11-07 06:17:02 +01:00
selftests: ALSA: pcmtest: Make room for the longest fill pattern
The driver accepts fill patterns of up to 4096 bytes, as pcmtest.rst
documents. The test reads each pattern into a 1024-byte buffer, using
the length the driver reports. So a pattern longer than 1024 bytes
overflows the buffer into the next pattern and past the array.
Size the buffer to the driver's maximum.
Fixes: 10b98a4db1 ("selftests: ALSA: Add test for the 'pcmtest' driver")
Assisted-by: Claude:claude-opus-5-5
Signed-off-by: HyeongJun An <sammiee5311@gmail.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Link: https://patch.msgid.link/7cbbcef84d2c14a2f0ec0ad2ba55c6ba0a15a8d8.1792390197.git.sammiee5311@gmail.com
This commit is contained in:
parent
317f2ddb66
commit
c338e77291
|
|
@ -10,9 +10,11 @@
|
|||
#include "kselftest_harness.h"
|
||||
|
||||
#define CH_NUM 4
|
||||
/* The driver accepts patterns of up to 4096 bytes */
|
||||
#define MAX_PATTERN_LEN 4096
|
||||
|
||||
struct pattern_buf {
|
||||
char buf[1024];
|
||||
char buf[MAX_PATTERN_LEN];
|
||||
int len;
|
||||
};
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user