fix monitor_proc_exit bug

This commit is contained in:
zy
2023-12-01 11:20:02 +08:00
parent f4b44b9a0d
commit 4be788ed42

View File

@@ -5,7 +5,7 @@
#include <linux/types.h>
#include <linux/uaccess.h>
char *proc_dir = "variable_monitor";
#define PROC_DIR = "variable_monitor"
int def_interval_ns = DEFAULT_INTERVAL_NS;
int dump_reset_sec = DEFAULT_DUMP_RESET_SEC;
@@ -67,7 +67,7 @@ static const struct proc_ops proc_dump_reset_sec_ops = {
int monitor_proc_init(void) {
struct proc_dir_entry *dir;
dir = proc_mkdir(proc_dir, NULL);
dir = proc_mkdir(PROC_DIR, NULL);
if (!dir) {
pr_err("variable_monitor: failed to create /proc directory\n");
return -ENOMEM;
@@ -82,6 +82,6 @@ int monitor_proc_init(void) {
int monitor_proc_exit(void) {
remove_proc_entry("def_interval_ns", NULL);
remove_proc_entry("dump_reset_sec", NULL);
remove_proc_entry(proc_dir, NULL);
remove_proc_subtree(PROC_DIR, NULL);
return 0;
}