Commit 5cc509aa authored by Navid Emamdoost's avatar Navid Emamdoost Committed by Kalle Valo

brcmfmac: Fix memory leak in brcmf_p2p_create_p2pdev()

In the implementation of brcmf_p2p_create_p2pdev() the allocated memory
for p2p_vif is leaked when the mac address is the same as primary
interface. To fix this, go to error path to release p2p_vif via
brcmf_free_vif().

Fixes: cb746e47 ("brcmfmac: check p2pdev mac address uniqueness")
Signed-off-by: default avatarNavid Emamdoost <navid.emamdoost@gmail.com>
Signed-off-by: default avatarKalle Valo <kvalo@codeaurora.org>
parent 57725b5b
...@@ -2092,7 +2092,8 @@ static struct wireless_dev *brcmf_p2p_create_p2pdev(struct brcmf_p2p_info *p2p, ...@@ -2092,7 +2092,8 @@ static struct wireless_dev *brcmf_p2p_create_p2pdev(struct brcmf_p2p_info *p2p,
/* firmware requires unique mac address for p2pdev interface */ /* firmware requires unique mac address for p2pdev interface */
if (addr && ether_addr_equal(addr, pri_ifp->mac_addr)) { if (addr && ether_addr_equal(addr, pri_ifp->mac_addr)) {
bphy_err(drvr, "discovery vif must be different from primary interface\n"); bphy_err(drvr, "discovery vif must be different from primary interface\n");
return ERR_PTR(-EINVAL); err = -EINVAL;
goto fail;
} }
brcmf_p2p_generate_bss_mac(p2p, addr); brcmf_p2p_generate_bss_mac(p2p, addr);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment