From a2c0bd8dd1f2ae929dc174fd77942c4d43b231b4 Mon Sep 17 00:00:00 2001 From: Jordan Yates Date: Fri, 15 Apr 2022 12:24:01 +1000 Subject: [PATCH] wifi: esp_at: notify receivers on async close `esp_close_work` can be queued from the `on_cmd_closed`, which clears `ESP_SOCK_CONNECTED` and sets `ESP_SOCK_CLOSE_PENDING`, but does no further work. The receive callback should still be run with no data when the socket is closed through this mechanism. Signed-off-by: Jordan Yates --- drivers/wifi/esp_at/esp_offload.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/wifi/esp_at/esp_offload.c b/drivers/wifi/esp_at/esp_offload.c index ff73e8af68a..5f044860c62 100644 --- a/drivers/wifi/esp_at/esp_offload.c +++ b/drivers/wifi/esp_at/esp_offload.c @@ -517,7 +517,7 @@ void esp_close_work(struct k_work *work) } /* Should we notify that the socket has been closed? */ - if (old_flags & ESP_SOCK_CONNECTED) { + if (old_flags & ESP_SOCK_CLOSE_PENDING) { k_mutex_lock(&sock->lock, K_FOREVER); if (sock->recv_cb) { sock->recv_cb(sock->context, NULL, NULL, NULL, 0,