mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
synced 2024-10-07 00:59:06 +00:00
accel/habanalabs: fix mem leak in capture user mappings
[ Upstream commit 314a7ffd7c
]
This commit fixes a memory leak caused when clearing the user_mappings
info when a new context is opened immediately after user_mapping is
captured and a hard reset is performed.
Signed-off-by: Moti Haimovski <mhaimovski@habana.ai>
Reviewed-by: Dani Liberman <dliberman@habana.ai>
Reviewed-by: Oded Gabbay <ogabbay@kernel.org>
Signed-off-by: Oded Gabbay <ogabbay@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
This commit is contained in:
parent
7f59afa93f
commit
973e0890e5
1 changed files with 2 additions and 0 deletions
|
@ -13,6 +13,7 @@
|
|||
|
||||
#include <linux/pci.h>
|
||||
#include <linux/module.h>
|
||||
#include <linux/vmalloc.h>
|
||||
|
||||
#define CREATE_TRACE_POINTS
|
||||
#include <trace/events/habanalabs.h>
|
||||
|
@ -218,6 +219,7 @@ int hl_device_open(struct inode *inode, struct file *filp)
|
|||
|
||||
hl_debugfs_add_file(hpriv);
|
||||
|
||||
vfree(hdev->captured_err_info.page_fault_info.user_mappings);
|
||||
memset(&hdev->captured_err_info, 0, sizeof(hdev->captured_err_info));
|
||||
atomic_set(&hdev->captured_err_info.cs_timeout.write_enable, 1);
|
||||
hdev->captured_err_info.undef_opcode.write_enable = true;
|
||||
|
|
Loading…
Reference in a new issue