]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
wil6210: drop old event after wmi_call timeout
authorAhmad Masri <amasri@codeaurora.org>
Sun, 16 Jun 2019 07:26:07 +0000 (10:26 +0300)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 26 Jul 2019 07:12:45 +0000 (09:12 +0200)
commit12058bfa8ca6adb2217d5bdd9201d2b4c1af6951
tree286f0a45e4421c2fe44a7eae8d84c1a44bbbc04e
parent9ef7f897f17e41bc8f0501b29a9b7cc541546d21
wil6210: drop old event after wmi_call timeout

[ Upstream commit 1a276003111c0404f6bfeffe924c5a21f482428b ]

This change fixes a rare race condition of handling WMI events after
wmi_call expires.

wmi_recv_cmd immediately handles an event when reply_buf is defined and
a wmi_call is waiting for the event.
However, in case the wmi_call has already timed-out, there will be no
waiting/running wmi_call and the event will be queued in WMI queue and
will be handled later in wmi_event_handle.
Meanwhile, a new similar wmi_call for the same command and event may
be issued. In this case, when handling the queued event we got WARN_ON
printed.

Fixing this case as a valid timeout and drop the unexpected event.

Signed-off-by: Ahmad Masri <amasri@codeaurora.org>
Signed-off-by: Maya Erez <merez@codeaurora.org>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/net/wireless/ath/wil6210/wmi.c