[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <AE90C24D6B3A694183C094C60CF0A2F6026B7223@saturn3.aculab.com>
Date: Fri, 3 May 2013 09:23:49 +0100
From: "David Laight" <David.Laight@...LAB.COM>
To: "Dan Carpenter" <dan.carpenter@...cle.com>,
"Petko Manolov" <petkan@...leusys.com>
Cc: "Greg Kroah-Hartman" <gregkh@...uxfoundation.org>,
"David S. Miller" <davem@...emloft.net>,
<linux-usb@...r.kernel.org>, <netdev@...r.kernel.org>,
<kernel-janitors@...r.kernel.org>
Subject: RE: [patch] usbnet: pegasus: endian bug in write_mii_word()
> We're only passing the two high bits of an integer. It works for little
^^^^ bytes
> endian but not for big endian.
>
> Signed-off-by: Dan Carpenter <dan.carpenter@...cle.com>
>
> diff --git a/drivers/net/usb/pegasus.c b/drivers/net/usb/pegasus.c
> index 0969905..03e8a15 100644
> --- a/drivers/net/usb/pegasus.c
> +++ b/drivers/net/usb/pegasus.c
> @@ -256,8 +256,9 @@ static int mdio_read(struct net_device *dev, int phy_id, int loc)
> static void mdio_write(struct net_device *dev, int phy_id, int loc, int val)
> {
> pegasus_t *pegasus = netdev_priv(dev);
> + u16 data = val;
>
> - write_mii_word(pegasus, phy_id, loc, (__u16 *)&val);
> + write_mii_word(pegasus, phy_id, loc, &data);
> }
>
> static int read_eprom_word(pegasus_t *pegasus, __u8 index, __u16 *retdata)
> --
> To unsubscribe from this list: send the line "unsubscribe netdev" in
> the body of a message to majordomo@...r.kernel.org
> More majordomo info at http://vger.kernel.org/majordomo-info.html
--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Powered by blists - more mailing lists