Skip to content

Commit

Permalink
net: stmmac: Fix incorrect memcpy source memory
Browse files Browse the repository at this point in the history
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: e7f4dc3 ("mdio: Move allocation of interrupts into core")
Signed-off-by: Marek Vasut <[email protected]>
Cc: David S. Miller <[email protected]>
Cc: Giuseppe Cavallaro <[email protected]>
Cc: Alexandre Torgue <[email protected]>
Reviewed-by: Andrew Lunn <[email protected]>
Signed-off-by: David S. Miller <[email protected]>
  • Loading branch information
Marek Vasut authored and davem330 committed May 26, 2016
1 parent 26c5f03 commit 643d60b
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion drivers/net/ethernet/stmicro/stmmac/stmmac_mdio.c
Original file line number Diff line number Diff line change
Expand Up @@ -297,7 +297,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)
Expand Down

0 comments on commit 643d60b

Please sign in to comment.