X-Git-Url: http://git.liburcu.org/?a=blobdiff_plain;f=lttng-statedump-impl.c;h=2ead9b6f12c1f99b7701d233a5c482d7a008e686;hb=1964cccb936a6dec5de336946f904b4b1006560e;hp=066b9612c0ee5f3884f023c1211eef17c58ad305;hpb=d2a927acb6018b445a2b254b7aa11e63acb77858;p=lttng-modules.git diff --git a/lttng-statedump-impl.c b/lttng-statedump-impl.c index 066b9612..2ead9b6f 100644 --- a/lttng-statedump-impl.c +++ b/lttng-statedump-impl.c @@ -426,14 +426,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); /*