Skip to content

Commit f2d1dfd

Browse files
krish2718rlubos
authored andcommitted
samples: wifi: ble_coex: Fix possible crash if Zperf fails
In case Zperf session fails (report not received) then the result can be NULL, add a NULL check. Signed-off-by: Chaitanya Tata <[email protected]>
1 parent e150bf9 commit f2d1dfd

File tree

1 file changed

+4
-0
lines changed
  • samples/wifi/ble_coex/src

1 file changed

+4
-0
lines changed

samples/wifi/ble_coex/src/main.c

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -284,6 +284,10 @@ static void udp_upload_results_cb(enum zperf_status status,
284284
break;
285285
case ZPERF_SESSION_FINISHED:
286286
LOG_INF("Wi-Fi benchmark: Upload completed!");
287+
if (!result) {
288+
LOG_ERR("Result is NULL, Zperf session error");
289+
break;
290+
}
287291
if (result->client_time_in_us != 0U) {
288292
client_rate_in_kbps = (uint32_t)
289293
(((uint64_t)result->nb_packets_sent *

0 commit comments

Comments
 (0)