From: Marek Vasut Date: Wed, 25 May 2016 22:40:23 +0000 (+0200) Subject: net: stmmac: Fix incorrect memcpy source memory X-Git-Tag: v4.6.3~70 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=0a626fb88972dfe5ebbf80412faae8fe723fb6c4;p=thirdparty%2Fkernel%2Fstable.git net: stmmac: Fix incorrect memcpy source memory [ Upstream commit 643d60bf575daaba93c1ac0d0e1c4b1d4ded1f75 ] The memcpy() currently copies mdio_bus_data into new_bus->irq, which makes no sense, since the mdio_bus_data structure contains more than just irqs. The code was likely supposed to copy mdio_bus_data->irqs into the new_bus->irq instead, so fix this. Fixes: e7f4dc3536a4 ("mdio: Move allocation of interrupts into core") Signed-off-by: Marek Vasut Cc: David S. Miller Cc: Giuseppe Cavallaro Cc: Alexandre Torgue Reviewed-by: Andrew Lunn Signed-off-by: David S. Miller Signed-off-by: Greg Kroah-Hartman --- diff --git a/drivers/net/ethernet/stmicro/stmmac/stmmac_mdio.c b/drivers/net/ethernet/stmicro/stmmac/stmmac_mdio.c index 06704ca6f9ca3..8683a21690b5d 100644 --- a/drivers/net/ethernet/stmicro/stmmac/stmmac_mdio.c +++ b/drivers/net/ethernet/stmicro/stmmac/stmmac_mdio.c @@ -209,7 +209,7 @@ int stmmac_mdio_register(struct net_device *ndev) return -ENOMEM; if (mdio_bus_data->irqs) - memcpy(new_bus->irq, mdio_bus_data, sizeof(new_bus->irq)); + memcpy(new_bus->irq, mdio_bus_data->irqs, sizeof(new_bus->irq)); #ifdef CONFIG_OF if (priv->device->of_node)