Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 93b42cae authored by Vasanthakumar Thiagarajan's avatar Vasanthakumar Thiagarajan Committed by Kalle Valo
Browse files

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: default avatarVasanthakumar Thiagarajan <vthiagar@qca.qualcomm.com>
Signed-off-by: default avatarKalle Valo <kvalo@qca.qualcomm.com>
parent 1881ced5
Loading
Loading
Loading
Loading
+7 −1
Original line number Original line Diff line number Diff line
@@ -854,6 +854,7 @@ static void ath6kl_htc_tx_from_queue(struct htc_target *target,
	int bundle_sent;
	int bundle_sent;
	int n_pkts_bundle;
	int n_pkts_bundle;
	u8 ac = WMM_NUM_AC;
	u8 ac = WMM_NUM_AC;
	int status;


	spin_lock_bh(&target->tx_lock);
	spin_lock_bh(&target->tx_lock);


@@ -915,7 +916,12 @@ static void ath6kl_htc_tx_from_queue(struct htc_target *target,


			ath6kl_htc_tx_prep_pkt(packet, packet->info.tx.flags,
			ath6kl_htc_tx_prep_pkt(packet, packet->info.tx.flags,
					       0, packet->info.tx.seqno);
					       0, packet->info.tx.seqno);
			ath6kl_htc_tx_issue(target, packet);
			status = ath6kl_htc_tx_issue(target, packet);

			if (status) {
				packet->status = status;
				packet->completion(packet->context, packet);
			}
		}
		}


		spin_lock_bh(&target->tx_lock);
		spin_lock_bh(&target->tx_lock);
+1 −1
Original line number Original line Diff line number Diff line
@@ -552,7 +552,7 @@ static int ath6kl_sdio_write_async(struct ath6kl *ar, u32 address, u8 *buffer,


	bus_req = ath6kl_sdio_alloc_busreq(ar_sdio);
	bus_req = ath6kl_sdio_alloc_busreq(ar_sdio);


	if (!bus_req)
	if (WARN_ON_ONCE(!bus_req))
		return -ENOMEM;
		return -ENOMEM;


	bus_req->address = address;
	bus_req->address = address;