]> git.ipfire.org Git - thirdparty/kernel/linux.git/commitdiff
wifi: ath12k: fix potential memory leak in ath12k_wow_arp_ns_offload()
authorAbdun Nihaal <nihaal@cse.iitm.ac.in>
Tue, 28 Oct 2025 17:04:55 +0000 (22:34 +0530)
committerJeff Johnson <jeff.johnson@oss.qualcomm.com>
Thu, 30 Oct 2025 21:55:07 +0000 (14:55 -0700)
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>
Reviewed-by: Baochen Qiang <baochen.qiang@oss.qualcomm.com>
Link: https://patch.msgid.link/20251028170457.134608-1-nihaal@cse.iitm.ac.in
Signed-off-by: Jeff Johnson <jeff.johnson@oss.qualcomm.com>
drivers/net/wireless/ath/ath12k/wow.c

index dce9bd0bcaefb88cc3416613f102ad4ed479f474..e8481626f194040cf0728597272801dfd1f8fda4 100644 (file)
@@ -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;
                }
        }