summaryrefslogtreecommitdiff
path: root/drivers/misc
diff options
context:
space:
mode:
authorfarah kassabri <fkassabri@habana.ai>2022-09-20 11:48:40 +0300
committerOded Gabbay <ogabbay@kernel.org>2022-11-23 17:13:45 +0300
commit679e968908a4997d02c2a7df294e97b066f9149f (patch)
treee494ebcf56b074dffd108c22f0251d1204ed5e19 /drivers/misc
parent4a9c6e2cdf2b4128f5204b9cf14e3a788a8511df (diff)
downloadlinux-679e968908a4997d02c2a7df294e97b066f9149f.tar.xz
habanalabs: zero ts registration buff when allocated
To avoid memory corruption in kernel memory while using timestamp registration nodes, zero the kernel buff memory when its allocated. Signed-off-by: farah kassabri <fkassabri@habana.ai> Reviewed-by: Oded Gabbay <ogabbay@kernel.org> Signed-off-by: Oded Gabbay <ogabbay@kernel.org>
Diffstat (limited to 'drivers/misc')
-rw-r--r--drivers/misc/habanalabs/common/memory.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/misc/habanalabs/common/memory.c b/drivers/misc/habanalabs/common/memory.c
index 99b1d6ce26ae..541e1b6a2176 100644
--- a/drivers/misc/habanalabs/common/memory.c
+++ b/drivers/misc/habanalabs/common/memory.c
@@ -2109,7 +2109,7 @@ static int hl_ts_alloc_buf(struct hl_mmap_mem_buf *buf, gfp_t gfp, void *args)
/* Allocate the internal kernel buffer */
size = num_elements * sizeof(struct hl_user_pending_interrupt);
- p = vmalloc(size);
+ p = vzalloc(size);
if (!p)
goto free_user_buff;