Skip to content

Commit

Permalink
wifi: eswifi: fix random crash due to work->handler set to NULL
Browse files Browse the repository at this point in the history
This fixes a random crash caused by race condition in the eswifi
driver used by the disco L475 iot1 board.

Signed-off-by: Michał Zając <m.zajac@avsystem.com>
  • Loading branch information
mzajac-avs authored and carlescufi committed Oct 19, 2022
1 parent 48fce02 commit f93c682
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion drivers/wifi/eswifi/eswifi_offload.c
Original file line number Diff line number Diff line change
Expand Up @@ -397,7 +397,7 @@ static int eswifi_off_put(struct net_context *context)
}

if (--socket->usage <= 0) {
memset(socket, 0, sizeof(*socket));
socket->context = NULL;
}
done:
eswifi_unlock(eswifi);
Expand Down
2 changes: 1 addition & 1 deletion drivers/wifi/eswifi/eswifi_socket_offload.c
Original file line number Diff line number Diff line change
Expand Up @@ -427,7 +427,7 @@ static int eswifi_socket_close(void *obj)
}

if (--socket->usage <= 0) {
memset(socket, 0, sizeof(*socket));
socket->context = NULL;
}

done:
Expand Down

0 comments on commit f93c682

Please sign in to comment.