From 0cfad497cba6c542e1c6d5e311e34642836d27ad Mon Sep 17 00:00:00 2001 From: Sathish Kumar Date: Fri, 23 Sep 2016 17:18:26 +0530 Subject: [PATCH] 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 --- qdf/linux/src/qdf_nbuf.c | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/qdf/linux/src/qdf_nbuf.c b/qdf/linux/src/qdf_nbuf.c index e61eb55687..bdc0d51a1e 100644 --- a/qdf/linux/src/qdf_nbuf.c +++ b/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); /**