Skip to content

Commit 314a7ff

Browse files
mhaimovskiogabbay
authored andcommitted
accel/habanalabs: fix mem leak in capture user mappings
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 <[email protected]> Reviewed-by: Dani Liberman <[email protected]> Reviewed-by: Oded Gabbay <[email protected]> Signed-off-by: Oded Gabbay <[email protected]>
1 parent e715008 commit 314a7ff

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

drivers/accel/habanalabs/common/habanalabs_drv.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@
1313

1414
#include <linux/pci.h>
1515
#include <linux/module.h>
16+
#include <linux/vmalloc.h>
1617

1718
#define CREATE_TRACE_POINTS
1819
#include <trace/events/habanalabs.h>
@@ -218,6 +219,7 @@ int hl_device_open(struct inode *inode, struct file *filp)
218219

219220
hl_debugfs_add_file(hpriv);
220221

222+
vfree(hdev->captured_err_info.page_fault_info.user_mappings);
221223
memset(&hdev->captured_err_info, 0, sizeof(hdev->captured_err_info));
222224
atomic_set(&hdev->captured_err_info.cs_timeout.write_enable, 1);
223225
hdev->captured_err_info.undef_opcode.write_enable = true;

0 commit comments

Comments
 (0)