[VOL-5421] - fix for crash during ChildDeviceLost
Change-Id: I4cbc4367ad829ec69b5928026789bb48044348f3
Signed-off-by: Sridhar Ravindra <sridhar.ravindra@radisys.com>
diff --git a/internal/pkg/core/device_handler.go b/internal/pkg/core/device_handler.go
index 3ded77b..98ea868 100755
--- a/internal/pkg/core/device_handler.go
+++ b/internal/pkg/core/device_handler.go
@@ -3165,6 +3165,12 @@
log.Fields{"parent-device-id": dh.device.Id, "pon-port": pPortNo, "onuID": onuID, "onuSN": onuSn})
return nil
}
+
+ if dh.transitionMap.currentDeviceState != deviceStateUp {
+ logger.Warnw(ctx, "device-is-not-up--not-handling-child-device-lost", log.Fields{"device-id": dh.device.Id, "current-device-state": dh.transitionMap.currentDeviceState})
+ return fmt.Errorf("device-is-not-up--not-handling-child-device-lost")
+ }
+
intfID := plt.PortNoToIntfID(pPortNo, voltha.Port_PON_OLT)
onuKey := dh.formOnuKey(intfID, onuID)