Netdev Archive on lore.kernel.org
 help / color / Atom feed
* [PATCH net-next] dpaa2-mac: fix the remove path for non-MAC interfaces
@ 2021-01-11 17:18 Ioana Ciornei
  2021-01-14  3:30 ` patchwork-bot+netdevbpf
  0 siblings, 1 reply; 2+ messages in thread
From: Ioana Ciornei @ 2021-01-11 17:18 UTC (permalink / raw)
  To: davem, kuba, netdev; +Cc: Ioana Ciornei

From: Ioana Ciornei <ioana.ciornei@nxp.com>

Check if the interface is indeed connected to a MAC before trying to
close the DPMAC object representing it. Without this check we end up
working with a NULL pointer.

Fixes: d87e606373f6 ("dpaa2-mac: export MAC counters even when in TYPE_FIXED")
Signed-off-by: Ioana Ciornei <ioana.ciornei@nxp.com>
---
 drivers/net/ethernet/freescale/dpaa2/dpaa2-eth.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/drivers/net/ethernet/freescale/dpaa2/dpaa2-eth.c b/drivers/net/ethernet/freescale/dpaa2/dpaa2-eth.c
index dd00c5de2115..7cb286e53369 100644
--- a/drivers/net/ethernet/freescale/dpaa2/dpaa2-eth.c
+++ b/drivers/net/ethernet/freescale/dpaa2/dpaa2-eth.c
@@ -4150,6 +4150,9 @@ static void dpaa2_eth_disconnect_mac(struct dpaa2_eth_priv *priv)
 	if (dpaa2_eth_is_type_phy(priv))
 		dpaa2_mac_disconnect(priv->mac);
 
+	if (!dpaa2_eth_has_mac(priv))
+		return;
+
 	dpaa2_mac_close(priv->mac);
 	kfree(priv->mac);
 	priv->mac = NULL;
-- 
2.29.2


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

* Re: [PATCH net-next] dpaa2-mac: fix the remove path for non-MAC interfaces
  2021-01-11 17:18 [PATCH net-next] dpaa2-mac: fix the remove path for non-MAC interfaces Ioana Ciornei
@ 2021-01-14  3:30 ` patchwork-bot+netdevbpf
  0 siblings, 0 replies; 2+ messages in thread
From: patchwork-bot+netdevbpf @ 2021-01-14  3:30 UTC (permalink / raw)
  To: Ioana Ciornei; +Cc: davem, kuba, netdev, ioana.ciornei

Hello:

This patch was applied to netdev/net-next.git (refs/heads/master):

On Mon, 11 Jan 2021 19:18:02 +0200 you wrote:
> From: Ioana Ciornei <ioana.ciornei@nxp.com>
> 
> Check if the interface is indeed connected to a MAC before trying to
> close the DPMAC object representing it. Without this check we end up
> working with a NULL pointer.
> 
> Fixes: d87e606373f6 ("dpaa2-mac: export MAC counters even when in TYPE_FIXED")
> Signed-off-by: Ioana Ciornei <ioana.ciornei@nxp.com>
> 
> [...]

Here is the summary with links:
  - [net-next] dpaa2-mac: fix the remove path for non-MAC interfaces
    https://git.kernel.org/netdev/net-next/c/848c1903d35e

You are awesome, thank you!
--
Deet-doot-dot, I am a bot.
https://korg.docs.kernel.org/patchwork/pwbot.html



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

end of thread, back to index

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-01-11 17:18 [PATCH net-next] dpaa2-mac: fix the remove path for non-MAC interfaces Ioana Ciornei
2021-01-14  3:30 ` patchwork-bot+netdevbpf

Netdev Archive on lore.kernel.org

Archives are clonable:
	git clone --mirror https://lore.kernel.org/netdev/0 netdev/git/0.git
	git clone --mirror https://lore.kernel.org/netdev/1 netdev/git/1.git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V2 netdev netdev/ https://lore.kernel.org/netdev \
		netdev@vger.kernel.org
	public-inbox-index netdev

Example config snippet for mirrors

Newsgroup available over NNTP:
	nntp://nntp.lore.kernel.org/org.kernel.vger.netdev


AGPL code for this site: git clone https://public-inbox.org/public-inbox.git