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

Commit 47960077 authored by Mohammed Shafi Shajakhan's avatar Mohammed Shafi Shajakhan Committed by John W. Linville
Browse files

ath9k: Fix memory leak due to failed PAPRD frames



free the skb's when the Tx of PAPRD frames fails and also add a debug
message indicating that.

Signed-off-by: default avatarMohammed Shafi Shajakhan <mshajakhan@atheros.com>
Signed-off-by: default avatarJohn W. Linville <linville@tuxdriver.com>
parent 9b00b415
Loading
Loading
Loading
Loading
+7 −1
Original line number Original line Diff line number Diff line
@@ -325,6 +325,8 @@ static bool ath_paprd_send_frame(struct ath_softc *sc, struct sk_buff *skb, int
{
{
	struct ieee80211_hw *hw = sc->hw;
	struct ieee80211_hw *hw = sc->hw;
	struct ieee80211_tx_info *tx_info = IEEE80211_SKB_CB(skb);
	struct ieee80211_tx_info *tx_info = IEEE80211_SKB_CB(skb);
	struct ath_hw *ah = sc->sc_ah;
	struct ath_common *common = ath9k_hw_common(ah);
	struct ath_tx_control txctl;
	struct ath_tx_control txctl;
	int time_left;
	int time_left;


@@ -342,8 +344,12 @@ static bool ath_paprd_send_frame(struct ath_softc *sc, struct sk_buff *skb, int
	init_completion(&sc->paprd_complete);
	init_completion(&sc->paprd_complete);
	sc->paprd_pending = true;
	sc->paprd_pending = true;
	txctl.paprd = BIT(chain);
	txctl.paprd = BIT(chain);
	if (ath_tx_start(hw, skb, &txctl) != 0)

	if (ath_tx_start(hw, skb, &txctl) != 0) {
		ath_dbg(common, ATH_DBG_XMIT, "PAPRD TX failed\n");
		dev_kfree_skb_any(skb);
		return false;
		return false;
	}


	time_left = wait_for_completion_timeout(&sc->paprd_complete,
	time_left = wait_for_completion_timeout(&sc->paprd_complete,
			msecs_to_jiffies(ATH_PAPRD_TIMEOUT));
			msecs_to_jiffies(ATH_PAPRD_TIMEOUT));