diff options
author | David Chiu <dchiu@synaptics.com> | 2022-05-20 21:41:19 +0800 |
---|---|---|
committer | Vincent Huang <vincenthsw@gmail.com> | 2022-09-28 16:40:25 +0800 |
commit | 1ed13a9ac1c367893f9e2a96909aa57cd3e8d7ff (patch) | |
tree | e850c07a3d6cea2123a30dc7901dc254670f4c96 | |
parent | 492fabbe22dd584a6f8056fc70a7ac3b569d8749 (diff) | |
download | rmi4utils-1ed13a9ac1c367893f9e2a96909aa57cd3e8d7ff.tar.gz |
Add error handling
-rwxr-xr-x | rmi4update/rmi4update.cpp | 4 |
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", |