ath10k: Correct error handling of dma_map_single()
The return value of dma_map_single() should be checked for errors using
dma_mapping_error() and the skb has been dequeued so it needs to be
freed.
This was found when enabling CONFIG_DMA_API_DEBUG and it warned about the
missing dma_mapping_error() call.
Fixes: 1807da4973
("ath10k: wmi: add management tx by reference support over wmi")
Reported-by: Niklas Cassel <niklas.cassel@linaro.org>
Signed-off-by: Bjorn Andersson <bjorn.andersson@linaro.org>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
This commit is contained in:

committed by
Kalle Valo

parent
f433abfc2f
commit
d43810b2c1
@@ -3904,8 +3904,10 @@ void ath10k_mgmt_over_wmi_tx_work(struct work_struct *work)
|
||||
ar->running_fw->fw_file.fw_features)) {
|
||||
paddr = dma_map_single(ar->dev, skb->data,
|
||||
skb->len, DMA_TO_DEVICE);
|
||||
if (!paddr)
|
||||
if (dma_mapping_error(ar->dev, paddr)) {
|
||||
ieee80211_free_txskb(ar->hw, skb);
|
||||
continue;
|
||||
}
|
||||
ret = ath10k_wmi_mgmt_tx_send(ar, skb, paddr);
|
||||
if (ret) {
|
||||
ath10k_warn(ar, "failed to transmit management frame by ref via WMI: %d\n",
|
||||
|
Reference in New Issue
Block a user