From: Mathieu Desnoyers Date: Mon, 24 Jun 2019 13:43:45 +0000 (-0400) Subject: Fix: lttng-tracepoint module notifier should return NOTIFY_OK X-Git-Tag: v2.9.14~4 X-Git-Url: https://git.lttng.org./?a=commitdiff_plain;h=9aaa730e2f04ed2b5e656e6bd10c0712ecb2bd87;p=lttng-modules.git Fix: lttng-tracepoint module notifier should return NOTIFY_OK Module notifiers should return NOTIFY_OK on success rather than the value 0. The return value 0 does not seem to have any ill side-effects in the notifier chain caller, but it is preferable to respect the API requirements in case this changes in the future. Notifiers can encapsulate a negative errno value with notifier_from_errno(), but this is not needed by the LTTng tracepoint notifier. The approach taken in this notifier is to just print a console warning on error, because tracing failure should not prevent loading a module. So we definitely do not want to stop notifier iteration. Returning an error without stopping iteration is not really that useful, because only the return value of the last callback is returned to notifier chain caller. Signed-off-by: Mathieu Desnoyers --- diff --git a/lttng-tracepoint.c b/lttng-tracepoint.c index 4cfec385..f2909ace 100644 --- a/lttng-tracepoint.c +++ b/lttng-tracepoint.c @@ -269,7 +269,7 @@ int lttng_tracepoint_coming(struct tp_module *tp_mod) } } mutex_unlock(<tng_tracepoint_mutex); - return 0; + return NOTIFY_OK; } static