mirror of
https://github.com/AuxXxilium/linux_dsm_epyc7002.git
synced 2024-12-28 11:18:45 +07:00
ath10k: fix potential memory leak in ath10k_wmi_tlv_op_pull_fw_stats()
ath10k_wmi_tlv_op_pull_fw_stats() uses tb = ath10k_wmi_tlv_parse_alloc(...) function, which allocates memory. If any of the three error-paths are taken, this tb needs to be freed. Signed-off-by: Christian Lamparter <chunkeey@googlemail.com> Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
This commit is contained in:
parent
8617690174
commit
097e46d2ae
@ -1105,8 +1105,10 @@ static int ath10k_wmi_tlv_op_pull_fw_stats(struct ath10k *ar,
|
||||
struct ath10k_fw_stats_pdev *dst;
|
||||
|
||||
src = data;
|
||||
if (data_len < sizeof(*src))
|
||||
if (data_len < sizeof(*src)) {
|
||||
kfree(tb);
|
||||
return -EPROTO;
|
||||
}
|
||||
|
||||
data += sizeof(*src);
|
||||
data_len -= sizeof(*src);
|
||||
@ -1126,8 +1128,10 @@ static int ath10k_wmi_tlv_op_pull_fw_stats(struct ath10k *ar,
|
||||
struct ath10k_fw_stats_vdev *dst;
|
||||
|
||||
src = data;
|
||||
if (data_len < sizeof(*src))
|
||||
if (data_len < sizeof(*src)) {
|
||||
kfree(tb);
|
||||
return -EPROTO;
|
||||
}
|
||||
|
||||
data += sizeof(*src);
|
||||
data_len -= sizeof(*src);
|
||||
@ -1145,8 +1149,10 @@ static int ath10k_wmi_tlv_op_pull_fw_stats(struct ath10k *ar,
|
||||
struct ath10k_fw_stats_peer *dst;
|
||||
|
||||
src = data;
|
||||
if (data_len < sizeof(*src))
|
||||
if (data_len < sizeof(*src)) {
|
||||
kfree(tb);
|
||||
return -EPROTO;
|
||||
}
|
||||
|
||||
data += sizeof(*src);
|
||||
data_len -= sizeof(*src);
|
||||
|
Loading…
Reference in New Issue
Block a user