From c3481cc7594b38a71c24cc3a4cd1cbbb8e68b9d5 Mon Sep 17 00:00:00 2001 From: Javier Pena Date: Wed, 26 Nov 2025 10:57:14 +0100 Subject: [PATCH] Ensure pin.ParentDevice length is ok in PhaseOffsetPin() In some cases, it is possible that the pinParentDevice property of a dpll pin is an empty list, such as when it is a SyncE port. Adding a check in PhaseOffsetPin() to avoid a crash. --- pkg/dpll/dpll.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pkg/dpll/dpll.go b/pkg/dpll/dpll.go index c2656c96..b6f6a56e 100644 --- a/pkg/dpll/dpll.go +++ b/pkg/dpll/dpll.go @@ -343,7 +343,7 @@ func (d *DpllConfig) Timer() int64 { func (d *DpllConfig) PhaseOffsetPin(pin *nl.PinInfo) bool { - if pin.ClockID == d.clockId && pin.ParentDevice[PPS_PIN_INDEX].PhaseOffset != math.MaxInt64 { + if pin.ClockID == d.clockId && len(pin.ParentDevice) > PPS_PIN_INDEX && pin.ParentDevice[PPS_PIN_INDEX].PhaseOffset != math.MaxInt64 { for k, v := range d.phaseOffsetPinFilter[strconv.FormatUint(d.clockId, 10)] { switch k { case "boardLabel":