mirror of
https://github.com/torvalds/linux.git
synced 2026-05-05 23:05:25 -04:00
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: 0ff0843310 ("wifi: brcmfmac: Add optional lpo clock enable support")
Signed-off-by: Abdun Nihaal <abdun.nihaal@gmail.com>
Acked-by: Arend van Spriel <arend.vanspriel@broadcom.com>
Link: https://patch.msgid.link/20250330103425.44197-1-abdun.nihaal@gmail.com
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
This commit is contained in:
committed by
Johannes Berg
parent
ff4ec537e4
commit
9e935c0fe3
@@ -561,8 +561,10 @@ struct brcmf_mp_device *brcmf_get_module_param(struct device *dev,
|
||||
if (!found) {
|
||||
/* No platform data for this device, try OF and DMI data */
|
||||
brcmf_dmi_probe(settings, chip, chiprev);
|
||||
if (brcmf_of_probe(dev, bus_type, settings) == -EPROBE_DEFER)
|
||||
if (brcmf_of_probe(dev, bus_type, settings) == -EPROBE_DEFER) {
|
||||
kfree(settings);
|
||||
return ERR_PTR(-EPROBE_DEFER);
|
||||
}
|
||||
brcmf_acpi_probe(dev, bus_type, settings);
|
||||
}
|
||||
return settings;
|
||||
|
||||
Reference in New Issue
Block a user