msm: ipa: Fix the memory leak in error cases
Free the skb if packet is not sent to ipa hw
successfully other than TX_BUSY error cases to avoid
memory leak.
Change-Id: I012484aa92e8f25ed0ad4f6709a54f40409ab8d2
CRs-Fixed: 1077525
Signed-off-by: Sunil Paidimarri <hisunil@codeaurora.org>
diff --git a/drivers/platform/msm/ipa/ipa_v2/rmnet_ipa.c b/drivers/platform/msm/ipa/ipa_v2/rmnet_ipa.c
index 560ffda..db732c5 100644
--- a/drivers/platform/msm/ipa/ipa_v2/rmnet_ipa.c
+++ b/drivers/platform/msm/ipa/ipa_v2/rmnet_ipa.c
@@ -1072,6 +1072,8 @@
IPAWANDBG
("SW filtering out none QMAP packet received from %s",
current->comm);
+ dev_kfree_skb_any(skb);
+ dev->stats.tx_dropped++;
return NETDEV_TX_OK;
}
@@ -1113,6 +1115,8 @@
if (ret) {
pr_err("[%s] fatal: ipa rm timer request resource failed %d\n",
dev->name, ret);
+ dev_kfree_skb_any(skb);
+ dev->stats.tx_dropped++;
return -EFAULT;
}
/* IPA_RM checking end */
@@ -1128,7 +1132,6 @@
if (ret) {
ret = NETDEV_TX_BUSY;
- dev->stats.tx_dropped++;
goto out;
}