mirror of
git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
synced 2025-08-05 16:54:27 +00:00
brcmfmac: fix memory leak in brcmf_flowring_add_tdls_peer()
In the error paths in brcmf_flowring_add_tdls_peer() the allocated resource should be freed. Reviewed-by: Hante Meuleman <hante.meuleman@broadcom.com> Reviewed-by: Pieter-Paul Giesberts <pieter-paul.giesberts@broadcom.com> Signed-off-by: Arend van Spriel <arend.vanspriel@broadcom.com> Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
This commit is contained in:
parent
704d1c6b56
commit
bc98164136
1 changed files with 6 additions and 2 deletions
|
@ -495,14 +495,18 @@ void brcmf_flowring_add_tdls_peer(struct brcmf_flowring *flow, int ifidx,
|
||||||
} else {
|
} else {
|
||||||
search = flow->tdls_entry;
|
search = flow->tdls_entry;
|
||||||
if (memcmp(search->mac, peer, ETH_ALEN) == 0)
|
if (memcmp(search->mac, peer, ETH_ALEN) == 0)
|
||||||
return;
|
goto free_entry;
|
||||||
while (search->next) {
|
while (search->next) {
|
||||||
search = search->next;
|
search = search->next;
|
||||||
if (memcmp(search->mac, peer, ETH_ALEN) == 0)
|
if (memcmp(search->mac, peer, ETH_ALEN) == 0)
|
||||||
return;
|
goto free_entry;
|
||||||
}
|
}
|
||||||
search->next = tdls_entry;
|
search->next = tdls_entry;
|
||||||
}
|
}
|
||||||
|
|
||||||
flow->tdls_active = true;
|
flow->tdls_active = true;
|
||||||
|
return;
|
||||||
|
|
||||||
|
free_entry:
|
||||||
|
kfree(tdls_entry);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Reference in a new issue