Skip to content

Commit

Permalink
ALSA: fireworks: fix an endianness bug for transaction length
Browse files Browse the repository at this point in the history
Although the 't->length' is a big-endian value, it's used without any
conversion. This means that the driver always uses 'length' parameter.

Fixes: 555e8a8("ALSA: fireworks: Add command/response functionality into hwdep interface")
Reported-by: Clemens Ladisch <clemens@ladisch.de>
Signed-off-by: Takashi Sakamoto <o-takashi@sakamocchi.jp>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
  • Loading branch information
takaswie authored and tiwai committed Jan 7, 2015
1 parent 60834b7 commit 92cb465
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion sound/firewire/fireworks/fireworks_transaction.c
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,7 @@ copy_resp_to_buf(struct snd_efw *efw, void *data, size_t length, int *rcode)
spin_lock_irq(&efw->lock);

t = (struct snd_efw_transaction *)data;
length = min_t(size_t, t->length * sizeof(t->length), length);
length = min_t(size_t, be32_to_cpu(t->length) * sizeof(u32), length);

if (efw->push_ptr < efw->pull_ptr)
capacity = (unsigned int)(efw->pull_ptr - efw->push_ptr);
Expand Down

0 comments on commit 92cb465

Please sign in to comment.