Hi,
In my pcie driver, I added a memory leak when open my pci device, the memory leak code are as follows, it will make a mem leak everytime when call syscall open.
```
diff --git a/kmd/itr/kmdlib/itr_fops.c b/kmd/itr/kmdlib/itr_fops.c
index 02350ee07..b80afee49 100644
--- a/kmd/itr/kmdlib/itr_fops.c
+++ b/kmd/itr/kmdlib/itr_fops.c
@@ -2310,6 +2310,7 @@ i32 itr_lib_open(void *file, int minor, void **private_data)
{
struct itr_lib_device *lib_dev;
struct itr_vdev *vdev;
+ void *leak_mem = NULL;
/* Find the itr */
lib_dev = find_lib_dev(minor);
@@ -2324,6 +2325,7 @@ i32 itr_lib_open(void *file, int minor, void **private_data)
vdev->file = file;
*private_data = vdev;
+ leak_mem = os_mem_kzalloc(1024);
return 0;
}
```
My linux kernel config has enabled the following config of kmemleak.
```
CONFIG_HAVE_DEBUG_KMEMLEAK=y
CONFIG_DEBUG_KMEMLEAK=y
CONFIG_DEBUG_KMEMLEAK_MEM_POOL_SIZE=16000
# CONFIG_DEBUG_KMEMLEAK_TEST is not set
# CONFIG_DEBUG_KMEMLEAK_DEFAULT_OFF is not set
CONFIG_DEBUG_KMEMLEAK_AUTO_SCAN=y
```
When i run syzkaller test, i ssh to the qemu vm, the dmesg shows the kmemleak thread is enabled, but the kmemleak thread has been ended
ensue.
```
➜ ~ dmesg | grep kmem
[ 19.269533] kmemleak: Kernel memory leak detector initialized (mem pool available: 12791)
[ 19.269573] kmemleak: Automatic memory scanning thread started
[ 40.055436] kmemleak: Automatic memory scanning thread ended
```
Any help is appreciated.