Skip to content

Commit bad3872

Browse files
committed
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 raspberrypi/firmware#1644 . Signed-off-by: Phil Elwell <[email protected]>
1 parent 9cca266 commit bad3872

File tree

1 file changed

+4
-2
lines changed
  • drivers/net/wireless/broadcom/brcm80211/brcmfmac

1 file changed

+4
-2
lines changed

drivers/net/wireless/broadcom/brcm80211/brcmfmac/sdio.c

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -651,8 +651,8 @@ static const struct brcmf_firmware_mapping sdio_fwnames[] = {
651651
BRCMF_FW_ENTRY(CY_CC_43012_CHIP_ID, 0xFFFFFFFF, 43012)
652652
};
653653

654-
static const struct brcmf_firmware_mapping *brcmf_sdio_fwnames = sdio_fwnames;
655-
static u32 brcmf_sdio_fwnames_count = ARRAY_SIZE(sdio_fwnames);
654+
static const struct brcmf_firmware_mapping *brcmf_sdio_fwnames;
655+
static u32 brcmf_sdio_fwnames_count;
656656

657657
#define TXCTL_CREDITS 2
658658

@@ -4539,6 +4539,8 @@ struct brcmf_sdio *brcmf_sdio_probe(struct brcmf_sdio_dev *sdiodev)
45394539

45404540
brcmf_dbg(INFO, "completed!!\n");
45414541

4542+
brcmf_sdio_fwnames = sdio_fwnames;
4543+
brcmf_sdio_fwnames_count = ARRAY_SIZE(sdio_fwnames);
45424544
of_fwnames = brcmf_of_fwnames(sdiodev->dev, &of_fw_count);
45434545
if (of_fwnames)
45444546
fwnames = devm_kcalloc(sdiodev->dev,

0 commit comments

Comments
 (0)