All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] net: stmmac: Fix incorrect memcpy source memory
@ 2016-05-25 22:40 Marek Vasut
  2016-05-26  0:20 ` David Miller
  2016-05-26  0:26 ` Andrew Lunn
  0 siblings, 2 replies; 4+ messages in thread
From: Marek Vasut @ 2016-05-25 22:40 UTC (permalink / raw)
  To: netdev
  Cc: Marek Vasut, David S . Miller, Giuseppe Cavallaro, Alexandre Torgue

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 <marex@denx.de>
Cc: David S. Miller <davem@davemloft.net>
Cc: Giuseppe Cavallaro <peppe.cavallaro@st.com>
Cc: Alexandre Torgue <alexandre.torgue@st.com>
---
 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

^ permalink raw reply related	[flat|nested] 4+ messages in thread

* Re: [PATCH] net: stmmac: Fix incorrect memcpy source memory
  2016-05-25 22:40 [PATCH] net: stmmac: Fix incorrect memcpy source memory Marek Vasut
@ 2016-05-26  0:20 ` David Miller
  2016-05-26  0:26 ` Andrew Lunn
  1 sibling, 0 replies; 4+ messages in thread
From: David Miller @ 2016-05-26  0:20 UTC (permalink / raw)
  To: marex; +Cc: netdev, peppe.cavallaro, alexandre.torgue, andrew

From: Marek Vasut <marex@denx.de>
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 <marex@denx.de>

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

Andrew, please review.

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH] net: stmmac: Fix incorrect memcpy source memory
  2016-05-25 22:40 [PATCH] net: stmmac: Fix incorrect memcpy source memory Marek Vasut
  2016-05-26  0:20 ` David Miller
@ 2016-05-26  0:26 ` Andrew Lunn
  2016-05-26  4:43   ` David Miller
  1 sibling, 1 reply; 4+ messages in thread
From: Andrew Lunn @ 2016-05-26  0:26 UTC (permalink / raw)
  To: Marek Vasut
  Cc: netdev, David S . Miller, Giuseppe Cavallaro, Alexandre Torgue

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 <marex@denx.de>
> Cc: David S. Miller <davem@davemloft.net>
> Cc: Giuseppe Cavallaro <peppe.cavallaro@st.com>
> Cc: Alexandre Torgue <alexandre.torgue@st.com>

Reviewed-by: Andrew Lunn <andrew@lunn.ch>

	     Andrew

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH] net: stmmac: Fix incorrect memcpy source memory
  2016-05-26  0:26 ` Andrew Lunn
@ 2016-05-26  4:43   ` David Miller
  0 siblings, 0 replies; 4+ messages in thread
From: David Miller @ 2016-05-26  4:43 UTC (permalink / raw)
  To: andrew; +Cc: marex, netdev, peppe.cavallaro, alexandre.torgue

From: Andrew Lunn <andrew@lunn.ch>
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 <marex@denx.de>
>> Cc: David S. Miller <davem@davemloft.net>
>> Cc: Giuseppe Cavallaro <peppe.cavallaro@st.com>
>> Cc: Alexandre Torgue <alexandre.torgue@st.com>
> 
> Reviewed-by: Andrew Lunn <andrew@lunn.ch>

Applied and queued up for -stable, thanks.

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2016-05-26  4:44 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-05-25 22:40 [PATCH] net: stmmac: Fix incorrect memcpy source memory Marek Vasut
2016-05-26  0:20 ` David Miller
2016-05-26  0:26 ` Andrew Lunn
2016-05-26  4:43   ` David Miller

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.