mdrv2: Attempt to update D-Bus objects in place

When systemInfoUpdate() is called multiple times, there's a potential
race condition of a user polling for the objects while the array of
D-Bus objects are erased and being repopulated. This results in
incomplete set of memory or CPU counts, which can lead to unforseen
consequences.

Tested: Verified that a corner case that was hitting this case
consistently (when SMBIOS was transferred using ipmi-blob repeatedly)
goes away with this implementation.

Signed-off-by: Brandon Kim <brandonkim@google.com>
Change-Id: I312aa91cd11b1dd06502d04272889922108d39a2
diff --git a/src/dimm.cpp b/src/dimm.cpp
index d106d47..c84bc51 100644
--- a/src/dimm.cpp
+++ b/src/dimm.cpp
@@ -39,8 +39,12 @@
     sdbusplus::server::xyz::openbmc_project::inventory::item::Dimm::Ecc;
 
 static constexpr uint16_t maxOldDimmSize = 0x7fff;
-void Dimm::memoryInfoUpdate(void)
+void Dimm::memoryInfoUpdate(uint8_t* smbiosTableStorage,
+                            const std::string& motherboard)
 {
+    storage = smbiosTableStorage;
+    motherboardPath = motherboard;
+
     uint8_t* dataIn = storage;
 
     dataIn = getSMBIOSTypePtr(dataIn, memoryDeviceType);