Add script to automate the syscall extraction process
[lttng-modules.git] / lttng-statedump-impl.c
index 043bbaa1a8eaee4b91655f8649ed2e4fccfb8cc5..f3ae1937b1faa5da94683d891311bc1013eb1bb8 100644 (file)
@@ -28,7 +28,6 @@
 #include <linux/inetdevice.h>
 #include <linux/sched.h>
 #include <linux/mm.h>
-#include <linux/fdtable.h>
 #include <linux/swap.h>
 #include <linux/wait.h>
 #include <linux/mutex.h>
@@ -43,7 +42,7 @@
 #include <wrapper/tracepoint.h>
 #include <wrapper/genhd.h>
 #include <wrapper/file.h>
-#include <wrapper/time.h>
+#include <wrapper/fdtable.h>
 
 #ifdef CONFIG_LTTNG_HAS_LIST_IRQ
 #include <linux/irq.h>
@@ -433,7 +432,16 @@ void lttng_statedump_process_ns(struct lttng_session *session,
        user_ns = task_cred_xxx(p, user_ns);
        do {
                trace_lttng_statedump_process_user_ns(session, p, user_ns);
-               user_ns = user_ns->lttng_user_ns_parent;
+               /*
+                * trace_lttng_statedump_process_user_ns() internally
+                * checks whether user_ns is NULL. While this does not
+                * appear to be a possible return value for
+                * task_cred_xxx(), err on the safe side and check
+                * for NULL here as well to be consistent with the
+                * paranoid behavior of
+                * trace_lttng_statedump_process_user_ns().
+                */
+               user_ns = user_ns ? user_ns->lttng_user_ns_parent : NULL;
        } while (user_ns);
 
        /*
This page took 0.02516 seconds and 4 git commands to generate.