mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-12 07:37:31 -04:00
qcacmn: Fix SKB double free issue in nl_srv_ucast
If netlink_unicast() fails it already frees SKB buffer hence do not double free the SKB when netlink_unicast() returns failure. Change-Id: I2aa99c47f99c573abbd281c06ff58fcb38aad76b CRs-Fixed: 2022800
This commit is contained in:
parent
849fd2c759
commit
a85d8b4ad7
1 changed files with 8 additions and 9 deletions
|
|
@ -147,15 +147,14 @@ int nl_srv_ucast(struct sk_buff *skb, int dst_pid, int flag)
|
|||
|
||||
if (nl_srv_is_initialized() == 0) {
|
||||
err = cnss_logger_nl_ucast(skb, dst_pid, flag);
|
||||
if (err < 0) {
|
||||
if (err < 0)
|
||||
QDF_TRACE(QDF_MODULE_ID_HDD, QDF_TRACE_LEVEL_WARN,
|
||||
"NLINK: netlink_unicast to pid[%d] failed, ret[%d]",
|
||||
dst_pid, err);
|
||||
dev_kfree_skb(skb);
|
||||
}
|
||||
}
|
||||
else
|
||||
} else {
|
||||
dev_kfree_skb(skb);
|
||||
}
|
||||
|
||||
return err;
|
||||
}
|
||||
|
||||
|
|
@ -567,14 +566,14 @@ int nl_srv_ucast(struct sk_buff *skb, int dst_pid, int flag)
|
|||
|
||||
if (nl_srv_sock) {
|
||||
err = netlink_unicast(nl_srv_sock, skb, dst_pid, flag);
|
||||
if (err < 0) {
|
||||
if (err < 0)
|
||||
QDF_TRACE(QDF_MODULE_ID_HDD, QDF_TRACE_LEVEL_WARN,
|
||||
"NLINK: netlink_unicast to pid[%d] failed, ret[%d]",
|
||||
dst_pid, err);
|
||||
dev_kfree_skb(skb);
|
||||
}
|
||||
} else
|
||||
} else {
|
||||
dev_kfree_skb(skb);
|
||||
}
|
||||
|
||||
return err;
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue