Commit
3242793cb8df ("P2P: Remove pending p2p-listen radio work on
stopping listen") added removal of all pending p2p-listen radio works
when P2P listen is stopped. But in case where p2p-listen radio work is
pending with work->started=1 and radio_remove_works() is called (e.g.,
as part of interface disabling), there is an attempt to remove radio
work iteratively from wpas_stop_listen() causing a crash.
To avoid this, add check to avoid iterative calls to wpas_stop_listen().
Signed-off-by: Shivani Baranwal <quic_shivbara@quicinc.com>
unsigned int duration;
if (deinit) {
- if (work->started) {
+ if (work->started && !wpa_s->p2p_removing_listen_work) {
wpa_s->p2p_listen_work = NULL;
wpas_stop_listen(wpa_s);
}