Skip to content

Commit

Permalink
Fix static analysis issues
Browse files Browse the repository at this point in the history
Fix various static analysis issues.

Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
  • Loading branch information
Peng Xu authored and jmalinen committed May 10, 2017
1 parent 7cd7f4f commit e9fa795
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 14 deletions.
2 changes: 1 addition & 1 deletion ap.c
Original file line number Diff line number Diff line change
Expand Up @@ -6960,7 +6960,7 @@ static int parse_send_frame_params_mac(char *param, struct sigma_cmd *cmd,
}
snprintf(temp, sizeof(temp), " %02x:%02x:%02x:%02x:%02x:%02x",
mac[0], mac[1], mac[2], mac[3], mac[4], mac[5]);
strncat(buf, temp, buf_size - strlen(temp) - 1);
strncat(buf, temp, buf_size - strlen(buf) - 1);
return 0;
}

Expand Down
16 changes: 7 additions & 9 deletions miracast.c
Original file line number Diff line number Diff line change
Expand Up @@ -452,11 +452,8 @@ static void * miracast_rtsp_thread_entry(void *ptr)
1-P-Sink, 2-Secondary Sink */
char *); /* for returning session ID */

if (!dut) {
sigma_dut_print(dut, DUT_MSG_ERROR,
"Bail out, RTSP thread has invalid parameters");
if (!dut)
goto EXIT;
}

miracast_load(dut);

Expand Down Expand Up @@ -643,11 +640,9 @@ static void * auto_go_thread_entry(void *ptr)
1-P-Sink, 2-Secondary Sink */
char *); /* for returning session ID */

if (!dut) {
sigma_dut_print(dut, DUT_MSG_ERROR,
"Bail out, RTSP thread has invalid parameters");
if (!dut)
goto THR_EXIT;
}

stop_dhcp(dut, wfd_ifname, 1);
/* For auto-GO, start the DHCP server and wait for 5 seconds */
start_dhcp(dut, wfd_ifname, 1);
Expand Down Expand Up @@ -782,7 +777,10 @@ int miracast_dev_send_frame(struct sigma_dut *dut, struct sigma_conn *conn,
return -1;
sigma_dut_print(dut, DUT_MSG_DEBUG, "miracast_dev_send_frame 1");
miracast_generate_string_cmd(cmd, string_cmd, sizeof(string_cmd));
if (strcasecmp(frame_name, "RTSP") != 0)
if (frame_name && strcasecmp(frame_name, "RTSP") != 0)
return 0;

if (!rtsp_msg_type)
return 0;

if (strcasecmp(rtsp_msg_type, "PAUSE") == 0 ||
Expand Down
5 changes: 1 addition & 4 deletions sta.c
Original file line number Diff line number Diff line change
Expand Up @@ -3085,12 +3085,9 @@ static int cmd_sta_preset_testparameters(struct sigma_dut *dut,
const char *val;

val = get_param(cmd, "Program");
if (val && strcasecmp(val, "HS2-R2") == 0) {
if (intf == NULL)
return -1;
if (val && strcasecmp(val, "HS2-R2") == 0)
return cmd_sta_preset_testparameters_hs2_r2(dut, conn, intf,
cmd);
}

if (val && strcasecmp(val, "LOC") == 0)
return loc_cmd_sta_preset_testparameters(dut, conn, cmd);
Expand Down

0 comments on commit e9fa795

Please sign in to comment.