Skip to content

Commit 9e935c0

Browse files
nifeyjmberg-intel
authored andcommitted
wifi: brcmfmac: fix memory leak in brcmf_get_module_param
The memory allocated for settings is not freed when brcmf_of_probe fails. Fix that by freeing settings before returning in error path. Fixes: 0ff0843 ("wifi: brcmfmac: Add optional lpo clock enable support") Signed-off-by: Abdun Nihaal <[email protected]> Acked-by: Arend van Spriel <[email protected]> Link: https://patch.msgid.link/[email protected] Signed-off-by: Johannes Berg <[email protected]>
1 parent ff4ec53 commit 9e935c0

File tree

1 file changed

+3
-1
lines changed
  • drivers/net/wireless/broadcom/brcm80211/brcmfmac

1 file changed

+3
-1
lines changed

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

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -561,8 +561,10 @@ struct brcmf_mp_device *brcmf_get_module_param(struct device *dev,
561561
if (!found) {
562562
/* No platform data for this device, try OF and DMI data */
563563
brcmf_dmi_probe(settings, chip, chiprev);
564-
if (brcmf_of_probe(dev, bus_type, settings) == -EPROBE_DEFER)
564+
if (brcmf_of_probe(dev, bus_type, settings) == -EPROBE_DEFER) {
565+
kfree(settings);
565566
return ERR_PTR(-EPROBE_DEFER);
567+
}
566568
brcmf_acpi_probe(dev, bus_type, settings);
567569
}
568570
return settings;

0 commit comments

Comments
 (0)