diff options
author | Arend Van Spriel <arend.vanspriel@broadcom.com> | 2016-09-19 07:09:53 -0400 |
---|---|---|
committer | Kalle Valo <kvalo@codeaurora.org> | 2016-09-26 13:35:53 -0400 |
commit | bc981641360183990de59da17f9f560f9150b801 (patch) | |
tree | c024435bd584368716652efef278db4aed3a9621 /drivers/net | |
parent | 704d1c6b56f4ee2ad6a5f012a72a278d17c1a223 (diff) |
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>
Diffstat (limited to 'drivers/net')
-rw-r--r-- | drivers/net/wireless/broadcom/brcm80211/brcmfmac/flowring.c | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/flowring.c b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/flowring.c index 7e269f9aa607..b16b367b0569 100644 --- a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/flowring.c +++ b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/flowring.c | |||
@@ -495,14 +495,18 @@ void brcmf_flowring_add_tdls_peer(struct brcmf_flowring *flow, int ifidx, | |||
495 | } else { | 495 | } else { |
496 | search = flow->tdls_entry; | 496 | search = flow->tdls_entry; |
497 | if (memcmp(search->mac, peer, ETH_ALEN) == 0) | 497 | if (memcmp(search->mac, peer, ETH_ALEN) == 0) |
498 | return; | 498 | goto free_entry; |
499 | while (search->next) { | 499 | while (search->next) { |
500 | search = search->next; | 500 | search = search->next; |
501 | if (memcmp(search->mac, peer, ETH_ALEN) == 0) | 501 | if (memcmp(search->mac, peer, ETH_ALEN) == 0) |
502 | return; | 502 | goto free_entry; |
503 | } | 503 | } |
504 | search->next = tdls_entry; | 504 | search->next = tdls_entry; |
505 | } | 505 | } |
506 | 506 | ||
507 | flow->tdls_active = true; | 507 | flow->tdls_active = true; |
508 | return; | ||
509 | |||
510 | free_entry: | ||
511 | kfree(tdls_entry); | ||
508 | } | 512 | } |