diff options
author | Chen,Yugang <yugang.chen@linux.intel.com> | 2019-09-06 11:03:05 +0800 |
---|---|---|
committer | Vernon Mauery <vernon.mauery@linux.intel.com> | 2019-09-23 17:50:41 +0000 |
commit | 0e862fabcc4772ec8f98c60ed3ddd004f785b6ce (patch) | |
tree | bd229ed2d500fe50f75492030158934c8907d9aa | |
parent | 98b43babb75177101499de4e8f55bbb19bea40ad (diff) | |
download | phosphor-host-ipmid-0e862fabcc4772ec8f98c60ed3ddd004f785b6ce.tar.gz phosphor-host-ipmid-0e862fabcc4772ec8f98c60ed3ddd004f785b6ce.zip |
Static code analysis scan issue fix
Fix the issues found during code static scan
Tested:
test in board, function works fine.
1. busctl set-property for watchdog, it works fine.
2. It works by running "ipmitool chassis power soft".
3. run "ipmitool raw 0x6 0x46 1", get expected user information.
Change-Id: I7a2cc3c934db6a7531f8a8ea05956cb6d6337633
Signed-off-by: Chen,Yugang <yugang.chen@linux.intel.com>
-rw-r--r-- | app/watchdog_service.cpp | 3 | ||||
-rw-r--r-- | host-interface.cpp | 2 | ||||
-rw-r--r-- | user_channel/user_mgmt.cpp | 4 |
3 files changed, 5 insertions, 4 deletions
diff --git a/app/watchdog_service.cpp b/app/watchdog_service.cpp index c567ca9..0eedf1b 100644 --- a/app/watchdog_service.cpp +++ b/app/watchdog_service.cpp @@ -153,7 +153,8 @@ void WatchdogService::setProperty(const std::string& key, const T& val) if (wasValid) { // Retry the request once in case the cached service was stale - return setProperty(key, val); + setProperty(key, val); + return; } log<level::ERR>("WatchdogService: Method error setting property", entry("PROPERTY=%s", key.c_str())); diff --git a/host-interface.cpp b/host-interface.cpp index 69ab376..1f9bfcb 100644 --- a/host-interface.cpp +++ b/host-interface.cpp @@ -54,7 +54,7 @@ void Host::execute(Base::Host::Command command) std::placeholders::_1, std::placeholders::_2)); - return ipmid_send_cmd_to_host(std::move(cmd)); + ipmid_send_cmd_to_host(std::move(cmd)); } // Called into by Command Manager diff --git a/user_channel/user_mgmt.cpp b/user_channel/user_mgmt.cpp index bf43f88..d0dcb38 100644 --- a/user_channel/user_mgmt.cpp +++ b/user_channel/user_mgmt.cpp @@ -1635,7 +1635,7 @@ void UserAccess::initUserDataFile() auto usrObj = managedObjs.find(usersPath); if (usrObj != managedObjs.end()) { - bool usrEnabled; + bool usrEnabled = false; // User exist. Lets check and update other fileds getUserObjProperties(usrObj->second, usrGrps, usrPriv, @@ -1692,7 +1692,7 @@ void UserAccess::initUserDataFile() { std::vector<std::string> usrGrps; std::string usrPriv, userName; - bool usrEnabled; + bool usrEnabled = false; std::string usrObjPath = std::string(usrObj.first); if (getUserNameFromPath(usrObj.first.str, userName) != 0) { |