diff options
| author | Liangwei Dong <liangwei@qti.qualcomm.com> | 2016-01-27 02:45:36 -0500 |
|---|---|---|
| committer | Gerrit - the friendly Code Review server <code-review@localhost> | 2016-01-28 03:35:23 -0800 |
| commit | 39bf7d49b95e61b15889b89590fa349ec88ef477 (patch) | |
| tree | cb15fdfe58577bc9babc7086e5f94e743fae19c6 | |
| parent | 33b0cb23cab55bd4377b3879d3cc06f9b6a8ad0c (diff) | |
qcacld-2.0: fix memory leak in nl_srv_bcast
skb should be freed if it is not sent to
netlink_broadcast api. otherwise, memory leak
will happen.
Change-Id: Ib8cf25b1cdf049136c7fe06125a4855499e28bc1
CRs-Fixed: 967630
| -rw-r--r-- | CORE/SVC/src/nlink/wlan_nlink_srv.c | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/CORE/SVC/src/nlink/wlan_nlink_srv.c b/CORE/SVC/src/nlink/wlan_nlink_srv.c index 9fc61ed08294..d7c64b5ba2e2 100644 --- a/CORE/SVC/src/nlink/wlan_nlink_srv.c +++ b/CORE/SVC/src/nlink/wlan_nlink_srv.c @@ -1,5 +1,5 @@ /* - * Copyright (c) 2012-2015 The Linux Foundation. All rights reserved. + * Copyright (c) 2012-2016 The Linux Foundation. All rights reserved. * * Previously licensed under the ISC license by Qualcomm Atheros, Inc. * @@ -172,7 +172,10 @@ int nl_srv_ucast(struct sk_buff *skb, int dst_pid, int flag) if (nl_srv_sock != NULL) { err = netlink_unicast(nl_srv_sock, skb, dst_pid, flag); + } else { + dev_kfree_skb(skb); } + if (err < 0) VOS_TRACE( VOS_MODULE_ID_HDD, VOS_TRACE_LEVEL_WARN, "NLINK: netlink_unicast to pid[%d] failed, ret[%d]", dst_pid, err); @@ -201,6 +204,8 @@ int nl_srv_bcast(struct sk_buff *skb) if (nl_srv_sock != NULL) { err = netlink_broadcast(nl_srv_sock, skb, 0, WLAN_NLINK_MCAST_GRP_ID, flags); + } else { + dev_kfree_skb(skb); } if (err < 0) { |
