Re: [PATCH] net: stmmac: Fix incorrect memcpy source memory

2016-05-25 Thread David Miller
From: Andrew Lunn 
Date: Thu, 26 May 2016 02:26:25 +0200

> On Thu, May 26, 2016 at 12:40:23AM +0200, Marek Vasut wrote:
>> 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.
>> 
>> Signed-off-by: Marek Vasut 
>> Cc: David S. Miller 
>> Cc: Giuseppe Cavallaro 
>> Cc: Alexandre Torgue 
> 
> Reviewed-by: Andrew Lunn 

Applied and queued up for -stable, thanks.


Re: [PATCH] net: stmmac: Fix incorrect memcpy source memory

2016-05-25 Thread Andrew Lunn
On Thu, May 26, 2016 at 12:40:23AM +0200, Marek Vasut wrote:
> 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.
> 
> Signed-off-by: Marek Vasut 
> Cc: David S. Miller 
> Cc: Giuseppe Cavallaro 
> Cc: Alexandre Torgue 

Reviewed-by: Andrew Lunn 

 Andrew


Re: [PATCH] net: stmmac: Fix incorrect memcpy source memory

2016-05-25 Thread David Miller
From: Marek Vasut 
Date: Thu, 26 May 2016 00:40:23 +0200

> 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.
> 
> Signed-off-by: Marek Vasut 

Fixes: e7f4dc3536a4 ("mdio: Move allocation of interrupts into core")

Andrew, please review.


[PATCH] net: stmmac: Fix incorrect memcpy source memory

2016-05-25 Thread Marek Vasut
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.

Signed-off-by: Marek Vasut 
Cc: David S. Miller 
Cc: Giuseppe Cavallaro 
Cc: Alexandre Torgue 
---
 drivers/net/ethernet/stmicro/stmmac/stmmac_mdio.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/net/ethernet/stmicro/stmmac/stmmac_mdio.c 
b/drivers/net/ethernet/stmicro/stmmac/stmmac_mdio.c
index 3f83c36..ec29585 100644
--- a/drivers/net/ethernet/stmicro/stmmac/stmmac_mdio.c
+++ b/drivers/net/ethernet/stmicro/stmmac/stmmac_mdio.c
@@ -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)
-- 
2.7.0