Thread (6 messages) 6 messages, 2 authors, 2013-01-09

Re: [PATCH] ath9k_htc: Fix skb leaks

From: Larry Finger <hidden>
Date: 2013-01-02 04:57:15
Also in: linux-wireless, lkml, stable

On 01/01/2013 10:30 PM, Sujith Manoharan wrote:
Larry Finger wrote:
quoted
diff --git a/drivers/net/wireless/ath/ath9k/htc_hst.c b/drivers/net/wireless/ath/ath9k/htc_hst.c
index 4a9570d..a304748 100644
--- a/drivers/net/wireless/ath/ath9k/htc_hst.c
+++ b/drivers/net/wireless/ath/ath9k/htc_hst.c
@@ -278,10 +278,12 @@ int htc_connect_service(struct htc_target *target,
  	if (!time_left) {
  		dev_err(target->dev, "Service connection timeout for: %d\n",
  			service_connreq->service_id);
-		return -ETIMEDOUT;
+		ret = -ETIMEDOUT;
+		goto err;
  	}

  	*conn_rsp_epid = target->conn_rsp_epid;
+	kfree_skb(skb);
  	return 0;
  err:
  	kfree_skb(skb);
ath9k_htc_txcompletion_cb()
The allocated skb should be freed in the TX completion hander,
ath9k_htc_txcompletion_cb() - doing it in htc_connect_service() is wrong, I think.
My only counter argument is that none of the other paths that get to 
ath9k_htc_txcompletion_cb() leak the skb. It only happens for the path that goes 
through htc_connect_service().

Larry
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help