platform-mc: Initialize poll event members in Terminus Initialize pollEvent, pollEventId, and pollDataTransferHandle using in-class member initializers so new Terminus objects start from a deterministic state. pollEventId and pollDataTransferHandle were previously left uninitialized until updated by the poll-event handling flow. Provide default values to avoid indeterminate state and make initialization explicit. Change-Id: I2516df5e301f41f6f2c464a1d12c12057e4ba872 Signed-off-by: Meghana Vangapandu <meghanav@ami.com>
diff --git a/platform-mc/terminus.cpp b/platform-mc/terminus.cpp index 5b33349..71897cf 100644 --- a/platform-mc/terminus.cpp +++ b/platform-mc/terminus.cpp
@@ -18,7 +18,7 @@ Terminus::Terminus(pldm_tid_t tid, uint64_t supportedTypes, sdeventplus::Event& event) : initialized(false), maxBufferSize(PLDM_PLATFORM_EVENT_MSG_MAX_BUFFER_SIZE), - synchronyConfigurationSupported(0), pollEvent(false), tid(tid), + synchronyConfigurationSupported(0), tid(tid), supportedTypes(supportedTypes), event(event) {}
diff --git a/platform-mc/terminus.hpp b/platform-mc/terminus.hpp index 4627737..4addf82 100644 --- a/platform-mc/terminus.hpp +++ b/platform-mc/terminus.hpp
@@ -147,16 +147,16 @@ * message that will require a multipart transfer via the * PollForPlatformEvent command */ - bool pollEvent; + bool pollEvent = false; /** @brief The sensor id is used in pollForPlatformMessage command */ - uint16_t pollEventId; + uint16_t pollEventId = 0; /** @brief The dataTransferHandle from `pldmMessagePollEvent` event and will * be used as `dataTransferHandle` for pollForPlatformMessage * command. */ - uint32_t pollDataTransferHandle; + uint32_t pollDataTransferHandle = 0; /** @brief Get Sensor Auxiliary Names by sensorID *