]> git.ipfire.org Git - thirdparty/kernel/stable.git/commitdiff
accel/habanalabs/gaudi2: Use kvfree() for memory allocated with kvcalloc()
authorThorsten Blum <thorsten.blum@toblux.com>
Tue, 20 Aug 2024 23:10:28 +0000 (01:10 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 28 Aug 2025 14:31:06 +0000 (16:31 +0200)
commit a44458dfd5bc0c79c6739c3f4c658361d3a5126b upstream.

Use kvfree() to fix the following Coccinelle/coccicheck warning reported
by kfree_mismatch.cocci:

  WARNING kvmalloc is used to allocate this memory at line 10398

Fixes: f728c17fc97a ("accel/habanalabs/gaudi2: move HMMU page tables to device memory")
Reported-by: Qianfeng Rong <rongqianfeng@vivo.com>
Closes: https://patch.msgid.link/20250808085530.233737-1-rongqianfeng@vivo.com
Signed-off-by: Thorsten Blum <thorsten.blum@linux.dev>
[lukas: acknowledge Qianfeng, adjust Thorsten's domain, add Fixes tag]
Signed-off-by: Lukas Wunner <lukas@wunner.de>
Reviewed-by: Tomer Tayar <ttayar@habana.ai>
Cc: stable@vger.kernel.org # v6.9+
Link: https://patch.msgid.link/20240820231028.136126-1-thorsten.blum@toblux.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/accel/habanalabs/gaudi2/gaudi2.c

index a38b88baadf2bae76519c1937257a7da935cb7ea..5722e4128d3cee8cc8fbc652347b9b198b94c031 100644 (file)
@@ -10437,7 +10437,7 @@ end:
                                (u64 *)(lin_dma_pkts_arr), DEBUGFS_WRITE64);
        WREG32(sob_addr, 0);
 
-       kfree(lin_dma_pkts_arr);
+       kvfree(lin_dma_pkts_arr);
 
        return rc;
 }