net: lan966x: check for ptp to be enabled in lan966x_ptp_deinit()
authorClément Léger <clement.leger@bootlin.com>
Mon, 9 Jan 2023 15:32:23 +0000 (16:32 +0100)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 18 Jan 2023 10:58:32 +0000 (11:58 +0100)
commitc2258d55935c23095e545c7e36f08d8b3433969b
tree6189496476d5973db573512f793ba454392f6530
parentbbc17e883cbad205d9d45b215b41d3dbad03168f
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@bootlin.com>
Reviewed-by: Horatiu Vultur <horatiu.vultur@microchip.com>
Reviewed-by: Jiri Pirko <jiri@nvidia.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/net/ethernet/microchip/lan966x/lan966x_ptp.c