diff options
author | Mark Brown <broonie@kernel.org> | 2024-10-07 14:01:00 +0100 |
---|---|---|
committer | Mark Brown <broonie@kernel.org> | 2024-10-07 14:01:00 +0100 |
commit | 85eadae61931f6268b49b5722039e5a248b9ee4c (patch) | |
tree | 3ee81f25a394ce2a2ec706f0aff07515b78d4b01 /fs/pidfs.c | |
parent | dc16594d9967773ca891b3d9111f152e3c99d1cf (diff) | |
parent | 8cf0b93919e13d1e8d4466eb4080a4c4d9d66d7b (diff) |
regulator: Merge up v6.12-rc2
Pulls in a build fix for the KVM selftests.
Diffstat (limited to 'fs/pidfs.c')
-rw-r--r-- | fs/pidfs.c | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/fs/pidfs.c b/fs/pidfs.c index 7ffdc88dfb52..80675b6bf884 100644 --- a/fs/pidfs.c +++ b/fs/pidfs.c @@ -120,6 +120,7 @@ static long pidfd_ioctl(struct file *file, unsigned int cmd, unsigned long arg) struct nsproxy *nsp __free(put_nsproxy) = NULL; struct pid *pid = pidfd_pid(file); struct ns_common *ns_common = NULL; + struct pid_namespace *pid_ns; if (arg) return -EINVAL; @@ -202,7 +203,9 @@ static long pidfd_ioctl(struct file *file, unsigned int cmd, unsigned long arg) case PIDFD_GET_PID_NAMESPACE: if (IS_ENABLED(CONFIG_PID_NS)) { rcu_read_lock(); - ns_common = to_ns_common( get_pid_ns(task_active_pid_ns(task))); + pid_ns = task_active_pid_ns(task); + if (pid_ns) + ns_common = to_ns_common(get_pid_ns(pid_ns)); rcu_read_unlock(); } break; |