From: Mathieu Desnoyers Date: Tue, 9 Jan 2024 15:33:13 +0000 (-0500) Subject: Fix: prio context NULL pointer exception X-Git-Url: https://git.lttng.org./?a=commitdiff_plain;h=1158b2706e58c2f94e6bd746e0504b989320c0a1;p=lttng-modules.git Fix: prio context NULL pointer exception A missing call to wrapper_task_prio_init() causes the function pointer for task_prio to stay NULL, which triggers a OOPS when trying to use the prio context. Signed-off-by: Mathieu Desnoyers Change-Id: I417e84cb8a07db624e682c7ec2c033fbc2a7b8e7 --- diff --git a/include/lttng/events-internal.h b/include/lttng/events-internal.h index a727230f..181b7b45 100644 --- a/include/lttng/events-internal.h +++ b/include/lttng/events-internal.h @@ -649,6 +649,7 @@ int lttng_add_pid_to_ctx(struct lttng_kernel_ctx **ctx); int lttng_add_cpu_id_to_ctx(struct lttng_kernel_ctx **ctx); int lttng_add_procname_to_ctx(struct lttng_kernel_ctx **ctx); int lttng_add_prio_to_ctx(struct lttng_kernel_ctx **ctx); +int wrapper_task_prio_init(void); int lttng_add_nice_to_ctx(struct lttng_kernel_ctx **ctx); int lttng_add_vpid_to_ctx(struct lttng_kernel_ctx **ctx); int lttng_add_tid_to_ctx(struct lttng_kernel_ctx **ctx); diff --git a/src/lttng-context-prio.c b/src/lttng-context-prio.c index a3034e4e..aac10a63 100644 --- a/src/lttng-context-prio.c +++ b/src/lttng-context-prio.c @@ -29,6 +29,7 @@ int wrapper_task_prio_init(void) } return 0; } +EXPORT_SYMBOL_GPL(wrapper_task_prio_init); /* * Canary function to check for 'task_prio()' at compile time. diff --git a/src/lttng-events.c b/src/lttng-events.c index a0bd2322..08884410 100644 --- a/src/lttng-events.c +++ b/src/lttng-events.c @@ -4148,6 +4148,9 @@ static int __init lttng_events_init(void) int ret; ret = wrapper_get_pfnblock_flags_mask_init(); + if (ret) + return ret; + ret = wrapper_task_prio_init(); if (ret) return ret; ret = lttng_probes_init();