]> git.ipfire.org Git - thirdparty/kernel/stable-queue.git/blob - releases/3.18.3/alsa-fireworks-fix-an-endianness-bug-for-transaction-length.patch
drop drm patch
[thirdparty/kernel/stable-queue.git] / releases / 3.18.3 / alsa-fireworks-fix-an-endianness-bug-for-transaction-length.patch
1 From 92cb46584e104e2f4b14a44959109ffe13524a26 Mon Sep 17 00:00:00 2001
2 From: Takashi Sakamoto <o-takashi@sakamocchi.jp>
3 Date: Thu, 8 Jan 2015 00:31:16 +0900
4 Subject: ALSA: fireworks: fix an endianness bug for transaction length
5
6 From: Takashi Sakamoto <o-takashi@sakamocchi.jp>
7
8 commit 92cb46584e104e2f4b14a44959109ffe13524a26 upstream.
9
10 Although the 't->length' is a big-endian value, it's used without any
11 conversion. This means that the driver always uses 'length' parameter.
12
13 Fixes: 555e8a8f7f14("ALSA: fireworks: Add command/response functionality into hwdep interface")
14 Reported-by: Clemens Ladisch <clemens@ladisch.de>
15 Signed-off-by: Takashi Sakamoto <o-takashi@sakamocchi.jp>
16 Signed-off-by: Takashi Iwai <tiwai@suse.de>
17 Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
18
19 ---
20 sound/firewire/fireworks/fireworks_transaction.c | 2 +-
21 1 file changed, 1 insertion(+), 1 deletion(-)
22
23 --- a/sound/firewire/fireworks/fireworks_transaction.c
24 +++ b/sound/firewire/fireworks/fireworks_transaction.c
25 @@ -124,7 +124,7 @@ copy_resp_to_buf(struct snd_efw *efw, vo
26 spin_lock_irq(&efw->lock);
27
28 t = (struct snd_efw_transaction *)data;
29 - length = min_t(size_t, t->length * sizeof(t->length), length);
30 + length = min_t(size_t, be32_to_cpu(t->length) * sizeof(u32), length);
31
32 if (efw->push_ptr < efw->pull_ptr)
33 capacity = (unsigned int)(efw->pull_ptr - efw->push_ptr);