THIS MODULE is defined to 0 when a module is built-in the kernel [1].
This caused NULL pointer dereference when booting a kernel with the
lttng-modules built-in.
To fix this issue, add #if guard around the wrapper_lttng_fixup_sig
function checking if the MODULE macro is defined to confirm that this
piece of code will end up in a module and not in the kernel itself.
[1]: linux/include/linux/export.h:32
Fixes: #1107
Signed-off-by: Francis Deslauriers <francis.deslauriers@efficios.com>
Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
}
}
+#endif /* CONFIG_MODULE_SIG */
+
+#if defined(CONFIG_MODULE_SIG) && defined(MODULE)
+
static inline
int wrapper_lttng_fixup_sig(struct module *mod)
{
return ret;
}
-#else /* CONFIG_MODULE_SIG */
+#else /* #if defined(CONFIG_MODULE_SIG) && defined(MODULE) */
static inline
int wrapper_lttng_fixup_sig(struct module *mod)
return 0;
}
-#endif /* #else CONFIG_MODULE_SIG */
+#endif /*#else #if defined(CONFIG_MODULE_SIG) && defined(MODULE) */
#endif /* _LTTNG_WRAPPER_TRACEPOINT_H */