Performance: special-case NULL in lttng_strlen_user_inatomic
authorMathieu Desnoyers <mathieu.desnoyers@efficios.com>
Mon, 26 Sep 2016 17:37:50 +0000 (13:37 -0400)
committerMathieu Desnoyers <mathieu.desnoyers@efficios.com>
Mon, 26 Sep 2016 17:38:42 +0000 (13:38 -0400)
Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
probes/lttng-probe-user.c

index e92107d94cfbd1948eb3773deb6c55a228f48505..099a66b229a46fcc90f7b5fd7e504a3806d7d0e6 100644 (file)
 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 (;;) {
This page took 0.026973 seconds and 4 git commands to generate.