Fix possible memory leak in mt7921_check_offload_capability routine
relasing fw data.
Fixes: 034ae28b56f1 ("wifi: mt76: mt7921: introduce remain_on_channel support")
Signed-off-by: Lorenzo Bianconi <[email protected]>
---
drivers/net/wireless/mediatek/mt76/mt7921/init.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/drivers/net/wireless/mediatek/mt76/mt7921/init.c b/drivers/net/wireless/mediatek/mt76/mt7921/init.c
index 542dfd425129..5ec0caa23c23 100644
--- a/drivers/net/wireless/mediatek/mt76/mt7921/init.c
+++ b/drivers/net/wireless/mediatek/mt76/mt7921/init.c
@@ -175,7 +175,7 @@ u8 mt7921_check_offload_capability(struct device *dev, const char *fw_wm)
if (!fw || !fw->data || fw->size < sizeof(*hdr)) {
dev_err(dev, "Invalid firmware\n");
- return -EINVAL;
+ goto out;
}
data = fw->data;
@@ -205,7 +205,7 @@ u8 mt7921_check_offload_capability(struct device *dev, const char *fw_wm)
data += le16_to_cpu(rel_info->len) + rel_info->pad_len;
}
-
+out:
release_firmware(fw);
return features ? features->data : 0;
--
2.39.0
> Fix possible memory leak in mt7921_check_offload_capability routine
> relasing fw data.
>
> Fixes: 034ae28b56f1 ("wifi: mt76: mt7921: introduce remain_on_channel support")
> Signed-off-by: Lorenzo Bianconi <[email protected]>
> ---
> drivers/net/wireless/mediatek/mt76/mt7921/init.c | 4 ++--
> 1 file changed, 2 insertions(+), 2 deletions(-)
Felix,
This issue has already a fix in your tree, we can drop the patch as well.
Regards,
Lorenzo
>
> diff --git a/drivers/net/wireless/mediatek/mt76/mt7921/init.c b/drivers/net/wireless/mediatek/mt76/mt7921/init.c
> index 542dfd425129..5ec0caa23c23 100644
> --- a/drivers/net/wireless/mediatek/mt76/mt7921/init.c
> +++ b/drivers/net/wireless/mediatek/mt76/mt7921/init.c
> @@ -175,7 +175,7 @@ u8 mt7921_check_offload_capability(struct device *dev, const char *fw_wm)
>
> if (!fw || !fw->data || fw->size < sizeof(*hdr)) {
> dev_err(dev, "Invalid firmware\n");
> - return -EINVAL;
> + goto out;
> }
>
> data = fw->data;
> @@ -205,7 +205,7 @@ u8 mt7921_check_offload_capability(struct device *dev, const char *fw_wm)
>
> data += le16_to_cpu(rel_info->len) + rel_info->pad_len;
> }
> -
> +out:
> release_firmware(fw);
>
> return features ? features->data : 0;
> --
> 2.39.0
>