]> asedeno.scripts.mit.edu Git - linux.git/commitdiff
qtnfmac: do not use bus mutex for events processing
authorIgor Mitsyanko <igor.mitsyanko.os@quantenna.com>
Mon, 22 Jan 2018 12:46:33 +0000 (15:46 +0300)
committerKalle Valo <kvalo@codeaurora.org>
Wed, 24 Jan 2018 16:00:55 +0000 (18:00 +0200)
Events processing requires locking of bus mutex, which is also used by
cfg80211 layer before calling several of cfg80211 callbacks. Since all
cfg80211 callbacks in qtnfmac driver also lock bus mutex, this
potentially may lead to a deadlock.

Do not use bus lock for event processing. Use RTNL lock instead to
serialize events and commands processing threads.

Signed-off-by: Igor Mitsyanko <igor.mitsyanko.os@quantenna.com>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
drivers/net/wireless/quantenna/qtnfmac/event.c

index 8a3d2b1194e4d610a20f4add6eb47250cc3ae802..bcd415f964129e5d2e7965047e809fed53dab846 100644 (file)
@@ -541,9 +541,9 @@ static int qtnf_event_process_skb(struct qtnf_bus *bus,
        if (unlikely(!mac))
                return -ENXIO;
 
-       qtnf_bus_lock(bus);
+       rtnl_lock();
        res = qtnf_event_parse(mac, skb);
-       qtnf_bus_unlock(bus);
+       rtnl_unlock();
 
        return res;
 }