X-Git-Url: http://review.tizen.org/git/?a=blobdiff_plain;f=kernel%2Fpid.c;h=bc21c0fb26d8b09e564aead32d8bb8b3d8a938d9;hb=d987ca1c6b7e22fbd30664111e85cec7aa66000d;hp=efd34874b3d12961277e083d63b200beeb1c3e0b;hpb=d1e7fd6462ca9fc76650fbe6ca800e35b24267da;p=platform%2Fkernel%2Flinux-starfive.git diff --git a/kernel/pid.c b/kernel/pid.c index efd3487..bc21c0f 100644 --- a/kernel/pid.c +++ b/kernel/pid.c @@ -244,6 +244,16 @@ struct pid *alloc_pid(struct pid_namespace *ns, pid_t *set_tid, tmp = tmp->parent; } + /* + * ENOMEM is not the most obvious choice especially for the case + * where the child subreaper has already exited and the pid + * namespace denies the creation of any new processes. But ENOMEM + * is what we have exposed to userspace for a long time and it is + * documented behavior for pid namespaces. So we can't easily + * change it even if there were an error code better suited. + */ + retval = -ENOMEM; + get_pid_ns(ns); refcount_set(&pid->count, 1); for (type = 0; type < PIDTYPE_MAX; ++type)