Commit 3d64fc705318e09d2c8544cec7169e45837a33dc

Authored by Dan Carpenter
Committed by David S. Miller
1 parent 0d05535d41

usbnet: pegasus: endian bug in write_mii_word()

We're only passing the two high bytes of an integer.  It works for
little endian but not for big endian.

Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: David S. Miller <davem@davemloft.net>

Showing 1 changed file with 2 additions and 1 deletions Side-by-side Diff

drivers/net/usb/pegasus.c
... ... @@ -256,8 +256,9 @@
256 256 static void mdio_write(struct net_device *dev, int phy_id, int loc, int val)
257 257 {
258 258 pegasus_t *pegasus = netdev_priv(dev);
  259 + u16 data = val;
259 260  
260   - write_mii_word(pegasus, phy_id, loc, (__u16 *)&val);
  261 + write_mii_word(pegasus, phy_id, loc, &data);
261 262 }
262 263  
263 264 static int read_eprom_word(pegasus_t *pegasus, __u8 index, __u16 *retdata)