* [PATCH] wifi: ath12k: fix potential memory leak in ath12k_wow_arp_ns_offload()
@ 2025-10-28 17:04 Abdun Nihaal
2025-10-29 2:02 ` Baochen Qiang
2025-10-30 21:57 ` Jeff Johnson
0 siblings, 2 replies; 3+ messages in thread
From: Abdun Nihaal @ 2025-10-28 17:04 UTC (permalink / raw)
To: jjohnson; +Cc: Abdun Nihaal, linux-wireless, ath12k, linux-kernel
When the call to ath12k_wmi_arp_ns_offload() fails, the temporary memory
allocation for offload is not freed before returning. Fix that by
freeing offload in the error path.
Fixes: 1666108c74c4 ("wifi: ath12k: support ARP and NS offload")
Signed-off-by: Abdun Nihaal <nihaal@cse.iitm.ac.in>
---
Compile tested only. Issue found using static analysis.
drivers/net/wireless/ath/ath12k/wow.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/drivers/net/wireless/ath/ath12k/wow.c b/drivers/net/wireless/ath/ath12k/wow.c
index dce9bd0bcaef..e8481626f194 100644
--- a/drivers/net/wireless/ath/ath12k/wow.c
+++ b/drivers/net/wireless/ath/ath12k/wow.c
@@ -758,6 +758,7 @@ static int ath12k_wow_arp_ns_offload(struct ath12k *ar, bool enable)
if (ret) {
ath12k_warn(ar->ab, "failed to set arp ns offload vdev %i: enable %d, ret %d\n",
arvif->vdev_id, enable, ret);
+ kfree(offload);
return ret;
}
}
--
2.43.0
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH] wifi: ath12k: fix potential memory leak in ath12k_wow_arp_ns_offload()
2025-10-28 17:04 [PATCH] wifi: ath12k: fix potential memory leak in ath12k_wow_arp_ns_offload() Abdun Nihaal
@ 2025-10-29 2:02 ` Baochen Qiang
2025-10-30 21:57 ` Jeff Johnson
1 sibling, 0 replies; 3+ messages in thread
From: Baochen Qiang @ 2025-10-29 2:02 UTC (permalink / raw)
To: Abdun Nihaal, jjohnson; +Cc: linux-wireless, ath12k, linux-kernel
On 10/29/2025 1:04 AM, Abdun Nihaal wrote:
> When the call to ath12k_wmi_arp_ns_offload() fails, the temporary memory
> allocation for offload is not freed before returning. Fix that by
> freeing offload in the error path.
>
> Fixes: 1666108c74c4 ("wifi: ath12k: support ARP and NS offload")
> Signed-off-by: Abdun Nihaal <nihaal@cse.iitm.ac.in>
> ---
> Compile tested only. Issue found using static analysis.
>
> drivers/net/wireless/ath/ath12k/wow.c | 1 +
> 1 file changed, 1 insertion(+)
>
> diff --git a/drivers/net/wireless/ath/ath12k/wow.c b/drivers/net/wireless/ath/ath12k/wow.c
> index dce9bd0bcaef..e8481626f194 100644
> --- a/drivers/net/wireless/ath/ath12k/wow.c
> +++ b/drivers/net/wireless/ath/ath12k/wow.c
> @@ -758,6 +758,7 @@ static int ath12k_wow_arp_ns_offload(struct ath12k *ar, bool enable)
> if (ret) {
> ath12k_warn(ar->ab, "failed to set arp ns offload vdev %i: enable %d, ret %d\n",
> arvif->vdev_id, enable, ret);
> + kfree(offload);
> return ret;
> }
> }
Reviewed-by: Baochen Qiang <baochen.qiang@oss.qualcomm.com>
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH] wifi: ath12k: fix potential memory leak in ath12k_wow_arp_ns_offload()
2025-10-28 17:04 [PATCH] wifi: ath12k: fix potential memory leak in ath12k_wow_arp_ns_offload() Abdun Nihaal
2025-10-29 2:02 ` Baochen Qiang
@ 2025-10-30 21:57 ` Jeff Johnson
1 sibling, 0 replies; 3+ messages in thread
From: Jeff Johnson @ 2025-10-30 21:57 UTC (permalink / raw)
To: jjohnson, Abdun Nihaal; +Cc: linux-wireless, ath12k, linux-kernel
On Tue, 28 Oct 2025 22:34:55 +0530, Abdun Nihaal wrote:
> When the call to ath12k_wmi_arp_ns_offload() fails, the temporary memory
> allocation for offload is not freed before returning. Fix that by
> freeing offload in the error path.
>
>
Applied, thanks!
[1/1] wifi: ath12k: fix potential memory leak in ath12k_wow_arp_ns_offload()
commit: be5febd51c478bc8e24ad3480435f2754a403b14
Best regards,
--
Jeff Johnson <jeff.johnson@oss.qualcomm.com>
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2025-10-30 21:57 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2025-10-28 17:04 [PATCH] wifi: ath12k: fix potential memory leak in ath12k_wow_arp_ns_offload() Abdun Nihaal
2025-10-29 2:02 ` Baochen Qiang
2025-10-30 21:57 ` Jeff Johnson
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®