Skip to content

Commit 74641bf

Browse files
geoffreybennetttiwai
authored andcommitted
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 <[email protected]> Signed-off-by: Takashi Iwai <[email protected]> Link: https://patch.msgid.link/[email protected]
1 parent 5c29308 commit 74641bf

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

sound/usb/mixer_scarlett2.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9516,7 +9516,7 @@ static long scarlett2_hwdep_write(struct snd_hwdep *hw,
95169516
SCARLETT2_FLASH_BLOCK_SIZE;
95179517

95189518
if (count < 0 || *offset < 0 || *offset + count >= flash_size)
9519-
return -EINVAL;
9519+
return -ENOSPC;
95209520

95219521
if (!count)
95229522
return 0;

0 commit comments

Comments
 (0)