]> git.karo-electronics.de Git - karo-tx-linux.git/commitdiff
sierra_net: Endianess bug fix.
authorLennart Sorensen <lsorense@csclub.uwaterloo.ca>
Fri, 7 Sep 2012 12:14:02 +0000 (12:14 +0000)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 12 Oct 2012 20:38:42 +0000 (05:38 +0900)
[ Upstream commit 2120c52da6fe741454a60644018ad2a6abd957ac ]

I discovered I couldn't get sierra_net to work on a powerpc.  Turns out
the firmware attribute check assumes the system is little endian and
hence fails because the attributes is a 16 bit value.

Signed-off-by: Len Sorensen <lsorense@csclub.uwaterloo.ca>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/net/usb/sierra_net.c

index cc9776c2a39a6fcd062e204902f81901d110427f..8789bc58b176577db275cabe2b538b553266a7a1 100644 (file)
@@ -678,7 +678,7 @@ static int sierra_net_get_fw_attr(struct usbnet *dev, u16 *datap)
                return -EIO;
        }
 
-       *datap = *attrdata;
+       *datap = le16_to_cpu(*attrdata);
 
        kfree(attrdata);
        return result;