netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH net v2] net: lan966x: check for ptp to be enabled in lan966x_ptp_deinit()
@ 2023-01-09 15:32 Clément Léger
  2023-01-09 18:46 ` Jiri Pirko
  2023-01-11  8:40 ` patchwork-bot+netdevbpf
  0 siblings, 2 replies; 3+ messages in thread
From: Clément Léger @ 2023-01-09 15:32 UTC (permalink / raw)
  To: Horatiu Vultur, UNGLinuxDriver, David S. Miller, Eric Dumazet,
	Jakub Kicinski, Paolo Abeni, Richard Cochran
  Cc: Clément Léger, netdev, linux-kernel

If ptp was not enabled due to missing IRQ for instance,
lan966x_ptp_deinit() will dereference NULL pointers.

Fixes: d096459494a8 ("net: lan966x: Add support for ptp clocks")
Signed-off-by: Clément Léger <clement.leger@bootlin.com>
Reviewed-by: Horatiu Vultur <horatiu.vultur@microchip.com>
---
Changes in v2:
 - Added Reviewed-by: Horatiu Vultur
 - Added net in patch subject to target net tree

 drivers/net/ethernet/microchip/lan966x/lan966x_ptp.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/drivers/net/ethernet/microchip/lan966x/lan966x_ptp.c b/drivers/net/ethernet/microchip/lan966x/lan966x_ptp.c
index f9ebfaafbebc..a8348437dd87 100644
--- a/drivers/net/ethernet/microchip/lan966x/lan966x_ptp.c
+++ b/drivers/net/ethernet/microchip/lan966x/lan966x_ptp.c
@@ -1073,6 +1073,9 @@ void lan966x_ptp_deinit(struct lan966x *lan966x)
 	struct lan966x_port *port;
 	int i;
 
+	if (!lan966x->ptp)
+		return;
+
 	for (i = 0; i < lan966x->num_phys_ports; i++) {
 		port = lan966x->ports[i];
 		if (!port)
-- 
2.38.1


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

* Re: [PATCH net v2] net: lan966x: check for ptp to be enabled in lan966x_ptp_deinit()
  2023-01-09 15:32 [PATCH net v2] net: lan966x: check for ptp to be enabled in lan966x_ptp_deinit() Clément Léger
@ 2023-01-09 18:46 ` Jiri Pirko
  2023-01-11  8:40 ` patchwork-bot+netdevbpf
  1 sibling, 0 replies; 3+ messages in thread
From: Jiri Pirko @ 2023-01-09 18:46 UTC (permalink / raw)
  To: Clément Léger
  Cc: Horatiu Vultur, UNGLinuxDriver, David S. Miller, Eric Dumazet,
	Jakub Kicinski, Paolo Abeni, Richard Cochran, netdev,
	linux-kernel

Mon, Jan 09, 2023 at 04:32:23PM CET, clement.leger@bootlin.com wrote:
>If ptp was not enabled due to missing IRQ for instance,
>lan966x_ptp_deinit() will dereference NULL pointers.
>
>Fixes: d096459494a8 ("net: lan966x: Add support for ptp clocks")
>Signed-off-by: Clément Léger <clement.leger@bootlin.com>
>Reviewed-by: Horatiu Vultur <horatiu.vultur@microchip.com>

Reviewed-by: Jiri Pirko <jiri@nvidia.com>

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

* Re: [PATCH net v2] net: lan966x: check for ptp to be enabled in lan966x_ptp_deinit()
  2023-01-09 15:32 [PATCH net v2] net: lan966x: check for ptp to be enabled in lan966x_ptp_deinit() Clément Léger
  2023-01-09 18:46 ` Jiri Pirko
@ 2023-01-11  8:40 ` patchwork-bot+netdevbpf
  1 sibling, 0 replies; 3+ messages in thread
From: patchwork-bot+netdevbpf @ 2023-01-11  8:40 UTC (permalink / raw)
  To: =?utf-8?b?Q2zDqW1lbnQgTMOpZ2VyIDxjbGVtZW50LmxlZ2VyQGJvb3RsaW4uY29tPg==?=
  Cc: horatiu.vultur, UNGLinuxDriver, davem, edumazet, kuba, pabeni,
	richardcochran, netdev, linux-kernel

Hello:

This patch was applied to netdev/net.git (master)
by David S. Miller <davem@davemloft.net>:

On Mon,  9 Jan 2023 16:32:23 +0100 you wrote:
> If ptp was not enabled due to missing IRQ for instance,
> lan966x_ptp_deinit() will dereference NULL pointers.
> 
> Fixes: d096459494a8 ("net: lan966x: Add support for ptp clocks")
> Signed-off-by: Clément Léger <clement.leger@bootlin.com>
> Reviewed-by: Horatiu Vultur <horatiu.vultur@microchip.com>
> 
> [...]

Here is the summary with links:
  - [net,v2] net: lan966x: check for ptp to be enabled in lan966x_ptp_deinit()
    https://git.kernel.org/netdev/net/c/b0e380b5d427

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] 3+ messages in thread

end of thread, other threads:[~2023-01-11  8:42 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-01-09 15:32 [PATCH net v2] net: lan966x: check for ptp to be enabled in lan966x_ptp_deinit() Clément Léger
2023-01-09 18:46 ` Jiri Pirko
2023-01-11  8:40 ` patchwork-bot+netdevbpf

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).