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

40 lines
1.5 KiB
Diff
Raw Normal View History

2022-04-22 15:00:47 +00:00
From 6b062fd9e25f964f44157e427213114d0734f693 Mon Sep 17 00:00:00 2001
2021-11-24 17:32:01 +00:00
From: Phil Elwell <phil@raspberrypi.com>
Date: Wed, 3 Nov 2021 11:53:13 +0000
2022-04-22 15:00:47 +00:00
Subject: [PATCH 577/828] brcmfmac: Protect against reprobing
2021-11-24 17:32:01 +00:00
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
2022-04-22 15:00:47 +00:00
@@ -661,8 +661,8 @@ static const struct brcmf_firmware_mappi
2021-11-24 17:32:01 +00:00
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
2022-04-22 15:00:47 +00:00
@@ -4556,6 +4556,8 @@ struct brcmf_sdio *brcmf_sdio_probe(stru
2021-11-24 17:32:01 +00:00
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,