Skip to content

Commit b0e380b

Browse files
clementlegerdavem330
authored andcommitted
net: lan966x: check for ptp to be enabled in lan966x_ptp_deinit()
If ptp was not enabled due to missing IRQ for instance, lan966x_ptp_deinit() will dereference NULL pointers. Fixes: d096459 ("net: lan966x: Add support for ptp clocks") Signed-off-by: Clément Léger <[email protected]> Reviewed-by: Horatiu Vultur <[email protected]> Reviewed-by: Jiri Pirko <[email protected]> Signed-off-by: David S. Miller <[email protected]>
1 parent 0aa7d35 commit b0e380b

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

drivers/net/ethernet/microchip/lan966x/lan966x_ptp.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1073,6 +1073,9 @@ void lan966x_ptp_deinit(struct lan966x *lan966x)
10731073
struct lan966x_port *port;
10741074
int i;
10751075

1076+
if (!lan966x->ptp)
1077+
return;
1078+
10761079
for (i = 0; i < lan966x->num_phys_ports; i++) {
10771080
port = lan966x->ports[i];
10781081
if (!port)

0 commit comments

Comments
 (0)