fix: y2038: hide timeval/timespec/itimerval/itimerspec types (v5.6)
[lttng-modules.git] / lttng-statedump-impl.c
index 066b9612c0ee5f3884f023c1211eef17c58ad305..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>
@@ -426,14 +425,23 @@ void lttng_statedump_process_ns(struct lttng_session *session,
        pid_ns = task_active_pid_ns(p);
        do {
                trace_lttng_statedump_process_pid_ns(session, p, pid_ns);
-               pid_ns = pid_ns->parent;
+               pid_ns = pid_ns ? pid_ns->parent : NULL;
        } while (pid_ns);
 
 
        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.023027 seconds and 4 git commands to generate.