This is a note to let you know that I've just added the patch titled net: lan966x: check for ptp to be enabled in lan966x_ptp_deinit() to the 6.1-stable tree which can be found at: http://www.kernel.org/git/?p=linux/kernel/git/stable/stable-queue.git;a=summary The filename of the patch is: net-lan966x-check-for-ptp-to-be-enabled-in-lan966x_p.patch and it can be found in the queue-6.1 subdirectory. If you, or anyone else, feels it should not be added to the stable tree, please let <stable@xxxxxxxxxxxxxxx> know about it. commit 0df047ca73826a8fb4b6a1130902297779947ea2 Author: Clément Léger <clement.leger@xxxxxxxxxxx> Date: Mon Jan 9 16:32:23 2023 +0100 net: lan966x: check for ptp to be enabled in lan966x_ptp_deinit() [ Upstream commit b0e380b5d4275299adf43e249f18309331b6f54f ] 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@xxxxxxxxxxx> Reviewed-by: Horatiu Vultur <horatiu.vultur@xxxxxxxxxxxxx> Reviewed-by: Jiri Pirko <jiri@xxxxxxxxxx> Signed-off-by: David S. Miller <davem@xxxxxxxxxxxxx> Signed-off-by: Sasha Levin <sashal@xxxxxxxxxx> diff --git a/drivers/net/ethernet/microchip/lan966x/lan966x_ptp.c b/drivers/net/ethernet/microchip/lan966x/lan966x_ptp.c index e5a2bbe064f8..8e368318558a 100644 --- a/drivers/net/ethernet/microchip/lan966x/lan966x_ptp.c +++ b/drivers/net/ethernet/microchip/lan966x/lan966x_ptp.c @@ -853,6 +853,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)