aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDavid Chiu <dchiu@synaptics.com>2022-05-20 21:41:19 +0800
committerVincent Huang <vincenthsw@gmail.com>2022-09-28 16:40:25 +0800
commit1ed13a9ac1c367893f9e2a96909aa57cd3e8d7ff (patch)
treee850c07a3d6cea2123a30dc7901dc254670f4c96
parent492fabbe22dd584a6f8056fc70a7ac3b569d8749 (diff)
downloadrmi4utils-1ed13a9ac1c367893f9e2a96909aa57cd3e8d7ff.tar.gz
Add error handling
-rwxr-xr-xrmi4update/rmi4update.cpp4
1 files changed, 4 insertions, 0 deletions
diff --git a/rmi4update/rmi4update.cpp b/rmi4update/rmi4update.cpp
index 6091842..cec3a84 100755
--- a/rmi4update/rmi4update.cpp
+++ b/rmi4update/rmi4update.cpp
@@ -161,6 +161,10 @@ int RMI4Update::UpdateFirmware(bool force, bool performLockdown)
if (IsBLv87()) {
if (m_firmwareImage.IsImageHasFirmwareVersion()) {
rc = ReadMSL();
+ if (rc != UPDATE_SUCCESS) {
+ fprintf(stderr, "%s: %s\n", __func__, update_err_to_string(rc));
+ goto reset;
+ }
fprintf(stdout, "MSL : 0x%x\n", m_MSL);
if (m_MSL > m_firmwareImage.GetFirmwareVersion()) {
fprintf(stdout, "MSL checking failed. device(0x%x) > image(0x%x)\n",