[Fix coverity issue]
[Description]
Fix coverity issue to align the original logic to check the return
value of strtol/strtoul.
[Release-log]
diff --git a/src/logan_wifi/wifi_hal.c b/src/logan_wifi/wifi_hal.c
index 4fe7e3c..1a3b56e 100644
--- a/src/logan_wifi/wifi_hal.c
+++ b/src/logan_wifi/wifi_hal.c
@@ -2345,26 +2345,15 @@
read = getline(&line, &len, f);
if (hal_strtoul(line, 10, &preActiveTime) < 0) {
wifi_debug(DEBUG_ERROR, "strtol fail\n");
- if (fclose(f) != 0) {
- wifi_debug(DEBUG_ERROR, "fclose fail\n");
- }
- return RETURN_ERR;
}
read = getline(&line, &len, f);
if (hal_strtoul(line, 10, &preBusyTime) < 0) {
wifi_debug(DEBUG_ERROR, "strtol fail\n");
- if (fclose(f) != 0) {
- wifi_debug(DEBUG_ERROR, "fclose fail\n");
- }
- return RETURN_ERR;
+
}
read = getline(&line, &len, f);
if (hal_strtoul(line, 10, &preTransmitTime) < 0) {
wifi_debug(DEBUG_ERROR, "strtol fail\n");
- if (fclose(f) != 0) {
- wifi_debug(DEBUG_ERROR, "fclose fail\n");
- }
- return RETURN_ERR;
}
if (fclose(f) == EOF)
@@ -6035,7 +6024,6 @@
if (hal_strtoul(Value, 10, &ret) < 0) {
wifi_debug(DEBUG_ERROR, "Unexpected strtoul fail\n");
- return RETURN_ERR;
}
pStats->radio_PacketsReceived = ret;
@@ -16399,7 +16387,6 @@
if (hal_strtoul(token, 10, &tmp) < 0) {
wifi_debug(DEBUG_ERROR, "Unexpected strtoul fail\n");
- return RETURN_ERR;
}
ofdma = tmp;
token = strtok(mimobuf, ";");
@@ -16410,7 +16397,6 @@
if (hal_strtoul(token, 10, &tmp) < 0) {
wifi_debug(DEBUG_ERROR, "Unexpected strtoul fail\n");
- return RETURN_ERR;
}
mimo = tmp;
@@ -16637,7 +16623,6 @@
if (hal_strtoul(temp_output, 10, &tmp) < 0) {
wifi_debug(DEBUG_ERROR, "Unexpected strtoul fail\n");
- return RETURN_ERR;
}
*color = tmp;
wifi_dbg_printf("\noutput_string=%s\n", color);
@@ -17439,14 +17424,12 @@
{
if (hal_strtoul(val, 16, &tmp) < 0) {
wifi_debug(DEBUG_ERROR, "Unexpected strtoul fail\n");
- return RETURN_ERR;
}
neighborReports[i - 3].info = tmp;
} else if (j == 2)
{
if (hal_strtoul(val, 16, &tmp) < 0) {
wifi_debug(DEBUG_ERROR, "Unexpected strtoul fail\n");
- return RETURN_ERR;
}
neighborReports[i - 3].opClass = tmp;
@@ -17454,14 +17437,12 @@
{
if (hal_strtoul(val, 16, &tmp) < 0) {
wifi_debug(DEBUG_ERROR, "Unexpected strtoul fail\n");
- return RETURN_ERR;
}
neighborReports[i - 3].channel = tmp;
} else if (j == 4)
{
if (hal_strtoul(val, 16, &tmp) < 0) {
wifi_debug(DEBUG_ERROR, "Unexpected strtoul fail\n");
- return RETURN_ERR;
}
neighborReports[i - 3].phyTable = tmp;
} else {
@@ -17941,7 +17922,6 @@
} else {
if (hal_strtoul(buf, 10, &tmp) < 0) {
wifi_debug(DEBUG_ERROR, "Unexpected strtoul fail\n");
- return RETURN_ERR;
}
operationParam->channel = tmp;
@@ -19430,7 +19410,6 @@
_syscmd(cmd, buf, sizeof(buf));
if (hal_strtoul(buf, 10, &tmp_u) < 0) {
wifi_debug(DEBUG_ERROR, "Unexpected strtoul fail\n");
- return RETURN_ERR;
}
*numSessionReturned = tmp_u - 1;
@@ -19494,7 +19473,6 @@
continue;
if (hal_strtoul(tmp, 10, &tmp_l) < 0) {
wifi_debug(DEBUG_ERROR, "Unexpected strtoul fail\n");
- return RETURN_ERR;
}
mantissa = tmp_l;
@@ -19502,7 +19480,6 @@
if (hal_strtoul(tmp, 10, &tmp_l) < 0) {
wifi_debug(DEBUG_ERROR, "Unexpected strtoul fail\n");
- return RETURN_ERR;
}
duration = tmp_l;