Linux wireless drivers development
 help / color / mirror / Atom feed
From: Josef Schlehofer <pepe.schlehofer@gmail.com>
To: Jeff Johnson <jjohnson@kernel.org>
Cc: linux-wireless@vger.kernel.org, stable@vger.kernel.org
Subject: [PATCH ath-next 2/3] wifi: ath6kl: use kvfree() for firmware
Date: Sun, 29 Nov 2026 16:47:09 +0100	[thread overview]
Message-ID: <20261129154710.86640-3-pepe.schlehofer@gmail.com> (raw)
In-Reply-To: <20261129154710.86640-1-pepe.schlehofer@gmail.com>

ar->fw is allocated with vmalloc() for API 2 and later firmware, but
with kmemdup() for API 1 firmware and for testmode firmware. vfree()
only handles the former, so unloading the driver in the kmemdup() case
warns "Trying to vfree() nonexistent vm area" and leaks the buffer.
Use kvfree() to handle both.

Observed when unloading an AR6006 hw1.1 with fw.ram.bin. With this
patch the warning is gone (tested on a big-endian QCA9563 with
backports 6.18.55).

Fixes: 8437754c8335 ("ath6kl: Use vmalloc instead of kmalloc for fw")
Cc: stable@vger.kernel.org
Signed-off-by: Josef Schlehofer <pepe.schlehofer@gmail.com>
---
 drivers/net/wireless/ath/ath6kl/core.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/net/wireless/ath/ath6kl/core.c b/drivers/net/wireless/ath/ath6kl/core.c
index 648110cd3..1ed773eca 100644
--- a/drivers/net/wireless/ath/ath6kl/core.c
+++ b/drivers/net/wireless/ath/ath6kl/core.c
@@ -348,7 +348,7 @@ void ath6kl_core_cleanup(struct ath6kl *ar)
 
 	kfree(ar->fw_board);
 	kfree(ar->fw_otp);
-	vfree(ar->fw);
+	kvfree(ar->fw);
 	kfree(ar->fw_patch);
 	kfree(ar->fw_testscript);
 
-- 
2.54.0 (Apple Git-157)


  parent reply	other threads:[~2026-11-29 15:47 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-11-29 15:47 [PATCH ath-next 0/3] wifi: ath6kl: fix issues found on big-endian MIPS Josef Schlehofer
2026-11-29 15:47 ` [PATCH ath-next 1/3] wifi: ath6kl: use little-endian BMI command fields Josef Schlehofer
2026-11-29 15:47 ` Josef Schlehofer [this message]
2026-11-29 15:47 ` [PATCH ath-next 3/3] wifi: ath6kl: use test_bit() for firmware capabilities Josef Schlehofer

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20261129154710.86640-3-pepe.schlehofer@gmail.com \
    --to=pepe.schlehofer@gmail.com \
    --cc=jjohnson@kernel.org \
    --cc=linux-wireless@vger.kernel.org \
    --cc=stable@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox