Fix the bugs found in static analysis
This commit fixes the following static analyzer reported issues:
Operands don't affect result
some conditions are not required to check as its always true
Unsigned compared against 0
Unchecked return value from library
Uninitialized scalar variable
Change-Id: I0b1fd426794bb88f6eafcc817cef5dd2f655e1ba
Signed-off-by: PavanKumarIntel <pavanx.kumar.martha@intel.com>
diff --git a/transporthandler.cpp b/transporthandler.cpp
index a9bc7c8..59d5f15 100644
--- a/transporthandler.cpp
+++ b/transporthandler.cpp
@@ -62,7 +62,6 @@
};
static constexpr uint8_t oemCmdStart = 192;
-static constexpr uint8_t oemCmdEnd = 255;
// Checks if the ifname is part of the networkd path
// This assumes the path came from the network subtree PATH_ROOT
@@ -1051,7 +1050,7 @@
}
}
- if ((parameter >= oemCmdStart) && (parameter <= oemCmdEnd))
+ if (parameter >= oemCmdStart)
{
return setLanOem(channel, parameter, req);
}
@@ -1354,7 +1353,7 @@
}
}
- if ((parameter >= oemCmdStart) && (parameter <= oemCmdEnd))
+ if (parameter >= oemCmdStart)
{
return getLanOem(channel, parameter, set, block);
}