mirror of
https://github.com/raspberrypi/linux.git
synced 2025-12-06 10:00:17 +00:00
net: lan966x: check for ptp to be enabled in lan966x_ptp_deinit()
[ Upstream commitb0e380b5d4] If ptp was not enabled due to missing IRQ for instance, lan966x_ptp_deinit() will dereference NULL pointers. Fixes:d096459494("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>
This commit is contained in:
committed by
Greg Kroah-Hartman
parent
bbc17e883c
commit
c2258d5593
@@ -853,6 +853,9 @@ void lan966x_ptp_deinit(struct lan966x *lan966x)
|
|||||||
struct lan966x_port *port;
|
struct lan966x_port *port;
|
||||||
int i;
|
int i;
|
||||||
|
|
||||||
|
if (!lan966x->ptp)
|
||||||
|
return;
|
||||||
|
|
||||||
for (i = 0; i < lan966x->num_phys_ports; i++) {
|
for (i = 0; i < lan966x->num_phys_ports; i++) {
|
||||||
port = lan966x->ports[i];
|
port = lan966x->ports[i];
|
||||||
if (!port)
|
if (!port)
|
||||||
|
|||||||
Reference in New Issue
Block a user