Ack ( Code review only)

Regards,
Ravi

-----Original Message-----
From: Gary Lee [mailto:[email protected]] 
Sent: Monday, October 23, 2017 8:48 AM
To: [email protected]; [email protected]; 
[email protected]
Cc: [email protected]; Gary Lee <[email protected]>
Subject: [PATCH 1/1] amfnd: store pid before sending event [#2650]

The event may be processed and pm_rec
deleted by the main thread, before it is read here.
---
 src/amf/amfnd/mon.cc | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/src/amf/amfnd/mon.cc b/src/amf/amfnd/mon.cc index 
5d5cc2393..9cdfc3797 100644
--- a/src/amf/amfnd/mon.cc
+++ b/src/amf/amfnd/mon.cc
@@ -263,6 +263,7 @@ err:
 uint32_t avnd_send_pid_exit_evt(AVND_CB *cb, AVND_COMP_PM_REC *pm_rec) {
   AVND_EVT *evt;
   uint32_t rc = NCSCC_RC_FAILURE;
+  const SaUint64T pid = pm_rec->pid;
 
   /* create & send the timer event */
   evt = avnd_evt_create(cb, AVND_EVT_PID_EXIT, 0, 0, (void *)pm_rec, 0, 0); @@ 
-271,9 +272,9 @@ uint32_t avnd_send_pid_exit_evt(AVND_CB *cb, AVND_COMP_PM_REC 
*pm_rec) {
   }
 
   if (rc == NCSCC_RC_SUCCESS) {
-    TRACE_1("Sent PM (PID: %lld) Exit event", pm_rec->pid);
+    TRACE_1("Sent PM (PID: %lld) Exit event", pid);
   } else {
-    LOG_ER("Failed to send PM (PID: %lld) exit event", pm_rec->pid);
+    LOG_ER("Failed to send PM (PID: %lld) exit event", pid);
   }
 
   return rc;
--
2.11.0

------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
_______________________________________________
Opensaf-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/opensaf-devel

Reply via email to