diff mbox series

ALSA: fireworks: fix wrong return count shorter than expected by 4 bytes

Message ID 20220424102428.21109-1-o-takashi@sakamocchi.jp
State Accepted
Commit eb9d84b0ffe39893cb23b0b6712bbe3637fa25fa
Headers show
Series ALSA: fireworks: fix wrong return count shorter than expected by 4 bytes | expand

Commit Message

Takashi Sakamoto April 24, 2022, 10:24 a.m. UTC
ALSA fireworks driver has a bug in its initial state to return count
shorter than expected by 4 bytes to userspace applications when handling
response frame for Echo Audio Fireworks transaction. It's due to missing
addition of the size for the type of event in ALSA firewire stack.

Fixes: 555e8a8f7f14 ("ALSA: fireworks: Add command/response functionality into hwdep interface")
Cc: <stable@vger.kernel.org>
Signed-off-by: Takashi Sakamoto <o-takashi@sakamocchi.jp>
---
 sound/firewire/fireworks/fireworks_hwdep.c | 1 +
 1 file changed, 1 insertion(+)

Comments

Takashi Iwai April 25, 2022, 6:04 a.m. UTC | #1
On Sun, 24 Apr 2022 12:24:28 +0200,
Takashi Sakamoto wrote:
> 
> ALSA fireworks driver has a bug in its initial state to return count
> shorter than expected by 4 bytes to userspace applications when handling
> response frame for Echo Audio Fireworks transaction. It's due to missing
> addition of the size for the type of event in ALSA firewire stack.
> 
> Fixes: 555e8a8f7f14 ("ALSA: fireworks: Add command/response functionality into hwdep interface")
> Cc: <stable@vger.kernel.org>
> Signed-off-by: Takashi Sakamoto <o-takashi@sakamocchi.jp>

Thanks, applied.


Takashi
diff mbox series

Patch

diff --git a/sound/firewire/fireworks/fireworks_hwdep.c b/sound/firewire/fireworks/fireworks_hwdep.c
index 626c0c34b0b6..3a53914277d3 100644
--- a/sound/firewire/fireworks/fireworks_hwdep.c
+++ b/sound/firewire/fireworks/fireworks_hwdep.c
@@ -34,6 +34,7 @@  hwdep_read_resp_buf(struct snd_efw *efw, char __user *buf, long remained,
 	type = SNDRV_FIREWIRE_EVENT_EFW_RESPONSE;
 	if (copy_to_user(buf, &type, sizeof(type)))
 		return -EFAULT;
+	count += sizeof(type);
 	remained -= sizeof(type);
 	buf += sizeof(type);