lkml.org 
[lkml]   [2015]   [Jan]   [14]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
    Patch in this message
    /
    From
    Subject[PATCH 3.18 079/150] ALSA: fireworks: fix an endianness bug for transaction length
    Date
    3.18-stable review patch.  If anyone has any objections, please let me know.

    ------------------

    From: Takashi Sakamoto <o-takashi@sakamocchi.jp>

    commit 92cb46584e104e2f4b14a44959109ffe13524a26 upstream.

    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: 555e8a8f7f14("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>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

    ---
    sound/firewire/fireworks/fireworks_transaction.c | 2 +-
    1 file changed, 1 insertion(+), 1 deletion(-)

    --- a/sound/firewire/fireworks/fireworks_transaction.c
    +++ b/sound/firewire/fireworks/fireworks_transaction.c
    @@ -124,7 +124,7 @@ copy_resp_to_buf(struct snd_efw *efw, vo
    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);



    \
     
     \ /
      Last update: 2015-01-14 09:41    [W:4.368 / U:0.112 seconds]
    ©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site