Skip to contentSkip to conversation

accel/habanalabs/gaudi2: Use kvfree() for memory allocated with kvcalloc()

PATCH RESEND Applied Thorsten Blum 2 participants 2 messages Aug 20, 2024 – Aug 16, 2025

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH RESEND 1/1 accel/habanalabs/gaudi2: Use kvfree() for memory allocated with kvcalloc()

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

---
 drivers/accel/habanalabs/gaudi2/gaudi2.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/accel/habanalabs/gaudi2/gaudi2.c +1 -1
index a38b88baadf2..5722e4128d3c 100644
@@ -10437,7 +10437,7 @@ static int gaudi2_memset_device_memory(struct hl_device *hdev, u64 addr, u64 siz
 				(u64 *)(lin_dma_pkts_arr), DEBUGFS_WRITE64);
 	WREG32(sob_addr, 0);
 
-	kfree(lin_dma_pkts_arr);
+	kvfree(lin_dma_pkts_arr);
 
 	return rc;
 }
Signature · 1 line
2.46.0
Applied
#1 lore raw
Quoted 7 lines · Thorsten Blum

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

Applied to drm-misc-fixes, thanks.

You used toblux.com in the Signed-off-by tag but have since amended .mailmap to use linux.dev instead. To avoid a mismatch between the Signed-off-by tag and the commit author, I've taken the liberty to hand-edit the former to use linux.dev.

I've also added a Fixes tag and stable designation.

Qianfeng Rong later submitted an identical patch, so I've added a Reported-by tag to acknowledge that:
https://patch.msgid.link/[email protected]

Thanks,

Lukas