added prints and close device

This commit is contained in:
twoneis 2025-03-27 21:55:42 +01:00
parent 95cc913f45
commit 9cabbefc77
3 changed files with 8 additions and 5 deletions

View file

@ -1,8 +1,8 @@
obj-m += lkm.o
all: module
all: module leak
run: module leak.c
run: leak
./leak
module:

BIN
code/leak Executable file

Binary file not shown.

View file

@ -3,8 +3,11 @@
int
main(void)
{
fopen("/dev/lkm", "r+");
printf("main: start\n");
FILE *device = fopen("/dev/lkm", "r+");
for (;;)
;
printf("main: fopen: %p\n", device);
fclose(device);
printf("main: done\n");
}