mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
synced 2026-02-21 23:29:26 -05:00
ALSA: scarlett2: Return ENOSPC for out-of-bounds flash writes
When writing to flash, return ENOSPC instead of EINVAL if the requested write would exceed the size of the flash segment. Signed-off-by: Geoffrey D. Bennett <g@b4.vu> Signed-off-by: Takashi Iwai <tiwai@suse.de> Link: https://patch.msgid.link/3a4af07b0329bed5ffb6994594e4f7bd202aad0f.1727971672.git.g@b4.vu
This commit is contained in:
committed by
Takashi Iwai
parent
5c293089af
commit
74641bfcbf
@@ -9516,7 +9516,7 @@ static long scarlett2_hwdep_write(struct snd_hwdep *hw,
|
||||
SCARLETT2_FLASH_BLOCK_SIZE;
|
||||
|
||||
if (count < 0 || *offset < 0 || *offset + count >= flash_size)
|
||||
return -EINVAL;
|
||||
return -ENOSPC;
|
||||
|
||||
if (!count)
|
||||
return 0;
|
||||
|
||||
Reference in New Issue
Block a user