From: Mathieu Desnoyers Date: Tue, 9 Jan 2024 15:33:13 +0000 (-0500) Subject: Fix: prio context NULL pointer exception X-Git-Tag: v2.13.11~4 X-Git-Url: https://git.lttng.org./?a=commitdiff_plain;h=43b9f0431625b5b5b6454066372819f08b0bd2bf;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 a91a659e..8f5b702a 100644 --- a/include/lttng/events-internal.h +++ b/include/lttng/events-internal.h @@ -611,6 +611,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 3c9251a0..0107b790 100644 --- a/src/lttng-events.c +++ b/src/lttng-events.c @@ -4365,6 +4365,9 @@ static int __init lttng_events_init(void) if (ret) return ret; ret = wrapper_get_pageblock_flags_mask_init(); + if (ret) + return ret; + ret = wrapper_task_prio_init(); if (ret) return ret; ret = lttng_probes_init();