VOL-3492 panic in rw-core.
error log, in case of agent.start() failure, uses nil reference of childDevice.
Change-Id: Ib6ab65b7a0ad6e8356f16f2977d72e0daf080816
(cherry picked from commit 23bd8c72e526400f25cfc6ebf1c13945c186ff90)
diff --git a/.gitreview b/.gitreview
index c70a26b..50460e5 100644
--- a/.gitreview
+++ b/.gitreview
@@ -3,3 +3,4 @@
port=29418
project=voltha-go.git
defaultremote=origin
+defaultbranch=voltha-2.5
diff --git a/VERSION b/VERSION
index aedc15b..9cf22a4 100644
--- a/VERSION
+++ b/VERSION
@@ -1 +1 @@
-2.5.3
+2.5.4-dev
diff --git a/rw_core/core/device/manager.go b/rw_core/core/device/manager.go
index 3b98cf8..345255f 100755
--- a/rw_core/core/device/manager.go
+++ b/rw_core/core/device/manager.go
@@ -1045,7 +1045,7 @@
// Create and start a device agent for that device
agent := newAgent(dMgr.adapterProxy, childDevice, dMgr, dMgr.dbPath, dMgr.dProxy, dMgr.defaultTimeout)
- childDevice, err := agent.start(ctx, childDevice)
+ insertedChildDevice, err := agent.start(ctx, childDevice)
if err != nil {
logger.Errorw(ctx, "error-starting-child-device", log.Fields{"parent-device-id": childDevice.ParentId, "child-device-id": agent.deviceID, "error": err})
return nil, err
@@ -1062,7 +1062,7 @@
}()
}
- return childDevice, nil
+ return insertedChildDevice, nil
}
func (dMgr *Manager) packetOut(ctx context.Context, deviceID string, outPort uint32, packet *ofp.OfpPacketOut) error {