提交 91a0cc44 编写于 作者: H Hector Martin 提交者: Zheng Zengkai

brcmfmac: pcie: Release firmwares in the brcmf_pcie_setup error path

stable inclusion
from stable-v5.10.110
commit f3820ddaf4f3ac80c7401ccc6a42e663c9317f31
bugzilla: https://gitee.com/openeuler/kernel/issues/I574AL

Reference: https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/commit/?id=f3820ddaf4f3ac80c7401ccc6a42e663c9317f31

--------------------------------

commit 5e90f0f3 upstream.

This avoids leaking memory if brcmf_chip_get_raminfo fails. Note that
the CLM blob is released in the device remove path.

Fixes: 82f93cf4 ("brcmfmac: get chip's default RAM info during PCIe setup")
Reviewed-by: NLinus Walleij <linus.walleij@linaro.org>
Reviewed-by: NArend van Spriel <arend.vanspriel@broadcom.com>
Cc: stable@vger.kernel.org
Signed-off-by: NHector Martin <marcan@marcan.st>
Reviewed-by: NAndy Shevchenko <andy.shevchenko@gmail.com>
Signed-off-by: NKalle Valo <kvalo@kernel.org>
Link: https://lore.kernel.org/r/20220131160713.245637-2-marcan@marcan.stSigned-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: NYu Liao <liaoyu15@huawei.com>
Reviewed-by: NWei Li <liwei391@huawei.com>
Signed-off-by: NZheng Zengkai <zhengzengkai@huawei.com>
上级 8fe8772d
...@@ -1775,6 +1775,8 @@ static void brcmf_pcie_setup(struct device *dev, int ret, ...@@ -1775,6 +1775,8 @@ static void brcmf_pcie_setup(struct device *dev, int ret,
ret = brcmf_chip_get_raminfo(devinfo->ci); ret = brcmf_chip_get_raminfo(devinfo->ci);
if (ret) { if (ret) {
brcmf_err(bus, "Failed to get RAM info\n"); brcmf_err(bus, "Failed to get RAM info\n");
release_firmware(fw);
brcmf_fw_nvram_free(nvram);
goto fail; goto fail;
} }
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册