X-Git-Url: http://git.liburcu.org/?a=blobdiff_plain;f=probes%2Flttng-probe-user.c;h=ed566ddb424b123a02f8ec1ba496517801a7eb2d;hb=0039dbe9891cfdf2c0d04691f83c2f342993dfd7;hp=e92107d94cfbd1948eb3773deb6c55a228f48505;hpb=156a3977f8fa114924d7bbd2bd04c94fd2ac0649;p=lttng-modules.git diff --git a/probes/lttng-probe-user.c b/probes/lttng-probe-user.c index e92107d9..ed566ddb 100644 --- a/probes/lttng-probe-user.c +++ b/probes/lttng-probe-user.c @@ -20,6 +20,7 @@ #include #include +#include #include /* @@ -31,15 +32,19 @@ 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 (;;) { char v; unsigned long ret; - if (unlikely(!access_ok(VERIFY_READ, + if (unlikely(!lttng_access_ok(VERIFY_READ, (__force const char __user *) addr, sizeof(v)))) break;