* [PATCH] wifi: mt76: mt7921: fix memory leak in mt7921_check_offload_capability
@ 2023-01-03 10:36 Lorenzo Bianconi
2023-01-16 12:33 ` Lorenzo Bianconi
0 siblings, 1 reply; 2+ messages in thread
From: Lorenzo Bianconi @ 2023-01-03 10:36 UTC (permalink / raw)
To: nbd; +Cc: lorenzo.bianconi, linux-wireless
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 <lorenzo@kernel.org>
---
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
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH] wifi: mt76: mt7921: fix memory leak in mt7921_check_offload_capability
2023-01-03 10:36 [PATCH] wifi: mt76: mt7921: fix memory leak in mt7921_check_offload_capability Lorenzo Bianconi
@ 2023-01-16 12:33 ` Lorenzo Bianconi
0 siblings, 0 replies; 2+ messages in thread
From: Lorenzo Bianconi @ 2023-01-16 12:33 UTC (permalink / raw)
To: Lorenzo Bianconi; +Cc: nbd, linux-wireless
[-- Attachment #1: Type: text/plain, Size: 1298 bytes --]
> 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 <lorenzo@kernel.org>
> ---
> 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
>
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 228 bytes --]
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2023-01-16 12:35 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-01-03 10:36 [PATCH] wifi: mt76: mt7921: fix memory leak in mt7921_check_offload_capability Lorenzo Bianconi
2023-01-16 12:33 ` Lorenzo Bianconi
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.