Skip to content

Commit

Permalink
Fix initialization of static.
Browse files Browse the repository at this point in the history
Return error instead of failing silently when page faults are disabled.
  • Loading branch information
anoop-sysd authored and bwolmarans committed Jan 12, 2018
1 parent 8766a50 commit 7e09185
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions driver/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -201,7 +201,7 @@ static struct tracepoint *tp_signal_deliver;
static struct tracepoint *tp_page_fault_user;
static struct tracepoint *tp_page_fault_kernel;
static bool g_fault_tracepoint_registered;
static bool g_fault_tracepoint_disabled = false;
static bool g_fault_tracepoint_disabled;
#endif

#ifdef _DEBUG
Expand Down Expand Up @@ -1031,8 +1031,8 @@ static long ppm_ioctl(struct file *filp, unsigned int cmd, unsigned long arg)
ASSERT(g_tracepoint_registered);

if (g_fault_tracepoint_disabled) {
ret = 0;
pr_info("kernel page fault tracepoints are disabled\n");
pr_err("kernel page fault tracepoints are disabled\n");
ret = -EPERM;
goto cleanup_ioctl;
}

Expand Down

0 comments on commit 7e09185

Please sign in to comment.