提交 b0e380b5 编写于 作者: C Clément Léger 提交者: David S. Miller

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: d0964594 ("net: lan966x: Add support for ptp clocks")
Signed-off-by: NClément Léger <clement.leger@bootlin.com>
Reviewed-by: NHoratiu Vultur <horatiu.vultur@microchip.com>
Reviewed-by: NJiri Pirko <jiri@nvidia.com>
Signed-off-by: NDavid S. Miller <davem@davemloft.net>
上级 0aa7d35f
...@@ -1073,6 +1073,9 @@ void lan966x_ptp_deinit(struct lan966x *lan966x) ...@@ -1073,6 +1073,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)
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册