Browse Source

qcacmn: Fix memory leak caused by fctxt overwriting ipa field in skb->cb

Memory leak is observed while running multicast to unicast conversion tests.
The reason was fctxt overwriting ipa field in skb->cb.
In struct qdf_nbuf_cb, offset of skb->cb->u.tx.dev.win.fctx happened to be
same as offset of skb->cb->u.tx.dev.mcl.ipa causing fctxt to sit on top of
ipa field and hence dev_kfree_skb () is not invoked.

Issue fix defines a different function that is invoked when ipa is not in use.

Change-Id: I47cb2a992730a2200b4315e492daa164d1bdfbda
CRs-Fixed: 1068852
Acked-by: Om Prakash Tripathi <[email protected]>
Sathish Kumar 8 years ago
parent
commit
0cfad497cb
1 changed files with 9 additions and 0 deletions
  1. 9 0
      qdf/linux/src/qdf_nbuf.c

+ 9 - 0
qdf/linux/src/qdf_nbuf.c

@@ -232,6 +232,8 @@ EXPORT_SYMBOL(__qdf_nbuf_alloc);
  *
  * Return: none
  */
+
+#ifdef CONFIG_MCL
 void __qdf_nbuf_free(struct sk_buff *skb)
 {
 	if (qdf_nbuf_ipa_owned_get(skb))
@@ -240,6 +242,13 @@ void __qdf_nbuf_free(struct sk_buff *skb)
 	else
 		dev_kfree_skb_any(skb);
 }
+#else
+void __qdf_nbuf_free(struct sk_buff *skb)
+{
+	dev_kfree_skb_any(skb);
+}
+#endif
+
 EXPORT_SYMBOL(__qdf_nbuf_free);
 
 /**