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 --- 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)