P2P: Fix P2P_FIND while waiting for listen ROC to start in the driver

It was possible for the p2p->pending_listen_freq to be left indicating
that there is a pending ROC for a listen operation if a P2P_FIND command
was timed to arrive suitably between a previous Listen operation issuing
a ROC request and the kernel code starting that request. This could
result in the P2P state machine getting stuck unable to continue the
find ("P2P: p2p_listen command pending already").

Fix this by clearing p2p->pending_listen_freq when starting P2P_FIND
command execution.

Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
This commit is contained in:
Jouni Malinen 2015-12-31 00:35:21 +02:00 committed by Jouni Malinen
parent ce43836965
commit e79eb0c660

View file

@ -1221,6 +1221,10 @@ int p2p_find(struct p2p_data *p2p, unsigned int timeout,
p2p->start_after_scan = P2P_AFTER_SCAN_NOTHING;
p2p_clear_timeout(p2p);
if (p2p->pending_listen_freq) {
p2p_dbg(p2p, "Clear pending_listen_freq for p2p_find");
p2p->pending_listen_freq = 0;
}
p2p->cfg->stop_listen(p2p->cfg->cb_ctx);
p2p->find_type = type;
p2p_device_clear_reported(p2p);