Re: [PATCH] net: fec: add support of ethtool get_regs

From: David Miller
Date: Sat May 09 2015 - 17:31:34 EST


From: Russell King - ARM Linux <linux@xxxxxxxxxxxxxxxx>
Date: Sat, 9 May 2015 22:17:46 +0100

> On Sat, May 09, 2015 at 10:52:08PM +0200, Philippe Reynes wrote:
>> +static void fec_enet_get_regs(struct net_device *ndev,
>> + struct ethtool_regs *regs, void *regbuf)
>> +{
>> + struct fec_enet_private *fep = netdev_priv(ndev);
>> +
>> + memcpy_fromio(regbuf, fep->hwp, regs->len);
>
> Using memcpy_fromio() to copy device registers is not a good idea -
> it can use a variable access size which can cause bus faults.

Agreed.
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/