wcn36xx: don't keep reference to skb if transmission failed
authorDaniel Mack <daniel@zonque.org>
Tue, 3 Apr 2018 16:51:53 +0000 (18:51 +0200)
committerKalle Valo <kvalo@codeaurora.org>
Tue, 10 Apr 2018 14:34:14 +0000 (17:34 +0300)
commit271f1e65ff38f18aa440fec17c759e70a6adfa4e
treeaab76853c94a375f9b7c7bf75b49ae64afc17e74
parent7cae35199bee1cd661926f2d68ac46d07682fc54
wcn36xx: don't keep reference to skb if transmission failed

When wcn36xx_dxe_tx_frame() fails to transmit the TX frame, the driver
will call into ieee80211_free_txskb() for the skb in flight, so it'll no
longer be valid. Hence, we shouldn't keep a reference to it in ctl->skb.
Also, if the skb has IEEE80211_TX_CTL_REQ_TX_STATUS set, a pointer to
it will currently remain in wcn->tx_ack_skb, which will potentially lead
to a crash if accessed later.

Fix this by checking the return value of wcn36xx_dxe_tx_frame(), and
nullify wcn->tx_ack_skb again in case of errors. Move the assignment
of ctl->skb in wcn36xx_dxe_tx_frame() so it only happens when the
transmission is successful.

Signed-off-by: Daniel Mack <daniel@zonque.org>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
drivers/net/wireless/ath/wcn36xx/dxe.c
drivers/net/wireless/ath/wcn36xx/txrx.c