From: Mathieu Desnoyers Date: Mon, 26 Sep 2016 17:37:50 +0000 (-0400) Subject: Performance: special-case NULL in lttng_strlen_user_inatomic X-Git-Tag: v2.9.0-rc1~7 X-Git-Url: http://git.lttng.org/?p=lttng-modules.git;a=commitdiff_plain;h=a824008cc30bf9a4b99aeb00657bbe2f0be9b653 Performance: special-case NULL in lttng_strlen_user_inatomic Signed-off-by: Mathieu Desnoyers --- diff --git a/probes/lttng-probe-user.c b/probes/lttng-probe-user.c index e92107d9..099a66b2 100644 --- a/probes/lttng-probe-user.c +++ b/probes/lttng-probe-user.c @@ -31,8 +31,12 @@ long lttng_strlen_user_inatomic(const char *addr) { long count = 0; - mm_segment_t old_fs = get_fs(); + mm_segment_t old_fs; + if (!addr) + return 0; + + old_fs = get_fs(); set_fs(KERNEL_DS); pagefault_disable(); for (;;) {