Skip to content

Commit

Permalink
drivers/wifi/esp_at: Fix system crash caused by null pointer
Browse files Browse the repository at this point in the history
The code for checking the null pointer is incorrect,
with ESP_AT_CIPDINFO_USE turned on, after a soft reboot
of the host and before a reboot of ESP32, the host may
receive an incorrect IPD message causing a system crash.

Fixes zephyrproject-rtos#81804

Signed-off-by: Hongquan Li <[email protected]>
  • Loading branch information
hongquan-prog committed Nov 29, 2024
1 parent 065bd32 commit d143703
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion drivers/wifi/esp_at/esp.c
Original file line number Diff line number Diff line change
Expand Up @@ -811,7 +811,7 @@ static int cmd_ipd_parse_hdr(struct esp_data *dev,
}

*sock = esp_socket_ref_from_link_id(dev, link_id);
if (!sock) {
if (*sock == NULL) {
LOG_ERR("No socket for link %ld", link_id);
return str - ipd_buf;
}
Expand Down

0 comments on commit d143703

Please sign in to comment.