From: Lennart Sorensen Date: Fri, 7 Sep 2012 12:14:02 +0000 (+0000) Subject: sierra_net: Endianess bug fix. X-Git-Tag: firefly_0821_release~7541^2~544 X-Git-Url: http://demsky.eecs.uci.edu/git/?a=commitdiff_plain;h=1af3bea6c3e3afbc033c2ab5917430d5192c84a3;p=firefly-linux-kernel-4.4.55.git sierra_net: Endianess bug fix. [ 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 Signed-off-by: David S. Miller Signed-off-by: Greg Kroah-Hartman --- diff --git a/drivers/net/usb/sierra_net.c b/drivers/net/usb/sierra_net.c index 864448b76120..e7732508b8f1 100644 --- a/drivers/net/usb/sierra_net.c +++ b/drivers/net/usb/sierra_net.c @@ -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;