Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

ath6kl: Complete failed tx packet in ath6kl_htc_tx_from_queue()

Return status of ath6kl_htc_tx_issue() is ignored in
ath6kl_htc_tx_from_queue(), but failed tx packet is
is not cleaned up. To fix memory leak in this case, call
completion with error. Also, throw an error debug message
when tx fails in ath6kl_sdio_write_async() due to shortage
in bus request buffer.

kvalo: change the error message to WARN_ON_ONCE()

Signed-off-by: Vasanthakumar Thiagarajan <vthiagar@qca.qualcomm.com>
Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>

authored by

Vasanthakumar Thiagarajan and committed by
Kalle Valo
93b42cae 1881ced5

+8 -2
+7 -1
drivers/net/wireless/ath/ath6kl/htc_mbox.c
··· 854 854 int bundle_sent; 855 855 int n_pkts_bundle; 856 856 u8 ac = WMM_NUM_AC; 857 + int status; 857 858 858 859 spin_lock_bh(&target->tx_lock); 859 860 ··· 916 915 917 916 ath6kl_htc_tx_prep_pkt(packet, packet->info.tx.flags, 918 917 0, packet->info.tx.seqno); 919 - ath6kl_htc_tx_issue(target, packet); 918 + status = ath6kl_htc_tx_issue(target, packet); 919 + 920 + if (status) { 921 + packet->status = status; 922 + packet->completion(packet->context, packet); 923 + } 920 924 } 921 925 922 926 spin_lock_bh(&target->tx_lock);
+1 -1
drivers/net/wireless/ath/ath6kl/sdio.c
··· 552 552 553 553 bus_req = ath6kl_sdio_alloc_busreq(ar_sdio); 554 554 555 - if (!bus_req) 555 + if (WARN_ON_ONCE(!bus_req)) 556 556 return -ENOMEM; 557 557 558 558 bus_req->address = address;