1
0
Fork 0
mirror of https://github.com/Ysurac/openmptcprouter.git synced 2025-02-15 04:42:02 +00:00
openmptcprouter/root/target/linux/bcm27xx/patches-5.15/950-0577-brcmfmac-Protect-against-reprobing.patch
Ycarus (Yannick Chabanois) 07d07219be Update bcm27xx 5.15 patches
2022-04-22 17:00:47 +02:00

39 lines
1.5 KiB
Diff

From 6b062fd9e25f964f44157e427213114d0734f693 Mon Sep 17 00:00:00 2001
From: Phil Elwell <phil@raspberrypi.com>
Date: Wed, 3 Nov 2021 11:53:13 +0000
Subject: [PATCH 577/828] brcmfmac: Protect against reprobing
It is important to reinitialise the firmware array pointers to protect
against the case that the brcmfmac driver is reprobed without first
being unloaded.
The potential hazard was noticed while investigating
https://github.com/raspberrypi/firmware/issues/1644 .
Signed-off-by: Phil Elwell <phil@raspberrypi.com>
---
drivers/net/wireless/broadcom/brcm80211/brcmfmac/sdio.c | 6 ++++--
1 file changed, 4 insertions(+), 2 deletions(-)
--- a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/sdio.c
+++ b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/sdio.c
@@ -661,8 +661,8 @@ static const struct brcmf_firmware_mappi
BRCMF_FW_ENTRY(CY_CC_43752_CHIP_ID, 0xFFFFFFFF, 43752)
};
-static const struct brcmf_firmware_mapping *brcmf_sdio_fwnames = sdio_fwnames;
-static u32 brcmf_sdio_fwnames_count = ARRAY_SIZE(sdio_fwnames);
+static const struct brcmf_firmware_mapping *brcmf_sdio_fwnames;
+static u32 brcmf_sdio_fwnames_count;
#define TXCTL_CREDITS 2
@@ -4556,6 +4556,8 @@ struct brcmf_sdio *brcmf_sdio_probe(stru
brcmf_dbg(INFO, "completed!!\n");
+ brcmf_sdio_fwnames = sdio_fwnames;
+ brcmf_sdio_fwnames_count = ARRAY_SIZE(sdio_fwnames);
of_fwnames = brcmf_of_fwnames(sdiodev->dev, &of_fw_count);
if (of_fwnames)
fwnames = devm_kcalloc(sdiodev->dev,