summaryrefslogtreecommitdiffstats
path: root/sound/usb
diff options
context:
space:
mode:
authorGeoffrey D. Bennett <g@b4.vu>2024-10-04 16:28:39 +0200
committerTakashi Iwai <tiwai@suse.de>2024-10-08 10:11:49 +0200
commit74641bfcbf4e698b770b1b62a74e73934843e90e (patch)
tree37e55f5620378d5440add7eb76692a53014dc9dc /sound/usb
parentALSA: scarlett2: Fix mixed declarations and code warning (diff)
downloadlinux-74641bfcbf4e698b770b1b62a74e73934843e90e.tar.xz
linux-74641bfcbf4e698b770b1b62a74e73934843e90e.zip
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
Diffstat (limited to 'sound/usb')
-rw-r--r--sound/usb/mixer_scarlett2.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/sound/usb/mixer_scarlett2.c b/sound/usb/mixer_scarlett2.c
index aa7c3d74ce8f..844e95cc965e 100644
--- a/sound/usb/mixer_scarlett2.c
+++ b/sound/usb/mixer_scarlett2.c
@@ -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;