diff options
Diffstat (limited to 'src/usr')
-rw-r--r-- | src/usr/isteps/ucd/updateUcdFlash.C | 14 |
1 files changed, 13 insertions, 1 deletions
diff --git a/src/usr/isteps/ucd/updateUcdFlash.C b/src/usr/isteps/ucd/updateUcdFlash.C index 5648a331f..267fb06fc 100644 --- a/src/usr/isteps/ucd/updateUcdFlash.C +++ b/src/usr/isteps/ucd/updateUcdFlash.C @@ -1282,14 +1282,22 @@ public: errlHndl_t pNonRetryableError = nullptr; errlHndl_t pRetryableError = nullptr; errlHndl_t pUcdError = nullptr; + size_t size = 0; for (uint8_t retry = 0; retry <= UCD_MAX_RETRIES; ++retry) { + // If an error occurs during the deviceOp then it's possible the + // size will be overwritten. So, create a local variable with the + // requested size. Regardless of success or failure the size + // returned from the final deviceOp will be written to + // io_bufferLength. + size = io_bufferLength; + // Perform deviceOp pUcdError = performDeviceOp(i_opType, i_smbusOpType, io_buffer, - io_bufferLength, + size, i_cmd); if ( (pUcdError != nullptr) @@ -1410,6 +1418,10 @@ public: } } + // Regardless of success or failure, update io_bufferLength with final + // size returned from performDeviceOp(). + io_bufferLength = size; + return pNonRetryableError; } |