From 42944de69b74175263dbccfce8dcdb315a3c4e69 Mon Sep 17 00:00:00 2001 From: Jouni Malinen Date: Wed, 16 Feb 2022 21:09:57 +0200 Subject: [PATCH] nl80211: Do not store no-wait TX frame cookies to be cancelled If the TX frame operation does not request any wait time, there is not going to be any pending wait that could be cancelled later. As such, there is no need to store the cookie value for these cases. This removes unnecessary cancel-TX-wait operations that would result in some extra latency and confusing debug log entries. This was found with the following hwsim test case sequence where the second test was failing due to the extra latency and this commit gets rid of that failure: rrm_ftm_range_req_timeout dpp_qr_code_auth_neg_chan Signed-off-by: Jouni Malinen --- src/drivers/driver_nl80211.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/drivers/driver_nl80211.c b/src/drivers/driver_nl80211.c index ce5a25beb..0b3c79411 100644 --- a/src/drivers/driver_nl80211.c +++ b/src/drivers/driver_nl80211.c @@ -8164,6 +8164,11 @@ static int nl80211_send_frame_cmd(struct i802_bss *bss, if (save_cookie) drv->send_frame_cookie = no_ack ? (u64) -1 : cookie; + if (!wait) { + /* There is no need to store this cookie since there + * is no wait that could be canceled later. */ + goto fail; + } if (drv->num_send_frame_cookies == MAX_SEND_FRAME_COOKIES) { wpa_printf(MSG_DEBUG, "nl80211: Drop oldest pending send frame cookie 0x%llx",