staging: r8192e_pci: fix htons error
authorSean MacLennan <seanm@seanm.ca>
Wed, 28 May 2014 15:19:00 +0000 (11:19 -0400)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 28 May 2014 21:46:51 +0000 (14:46 -0700)
A sparse error fixup removed a htons() which is required for the driver
to function. This patch puts the htons() back and fixes the sparse
warning correctly by changing the left side cast.

Signed-off-by: Sean MacLennan <seanm@seanm.ca>
Cc: stable <stable@vger.kernel.org> # 3.14
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/staging/rtl8192e/rtllib_tx.c

index 11d0a9d8ee59fc911dd753c425cfe1e9f698ca5f..b7dd1539bbc4b0c8e388bcaf69b460ef00b81bd9 100644 (file)
@@ -171,7 +171,7 @@ inline int rtllib_put_snap(u8 *data, u16 h_proto)
        snap->oui[1] = oui[1];
        snap->oui[2] = oui[2];
 
-       *(u16 *)(data + SNAP_SIZE) = h_proto;
+       *(__be16 *)(data + SNAP_SIZE) = htons(h_proto);
 
        return SNAP_SIZE + sizeof(u16);
 }