Commit 5e6b8a50 authored by Yang Yingliang's avatar Yang Yingliang Committed by Eric W. Biederman

cred: add missing return error code when set_cred_ucounts() failed

If set_cred_ucounts() failed, we need return the error code.

Fixes: 905ae01c ("Add a reference to ucounts for each cred")
Reported-by: default avatarHulk Robot <hulkci@huawei.com>
Signed-off-by: default avatarYang Yingliang <yangyingliang@huawei.com>
Link: https://lkml.kernel.org/r/20210526143805.2549649-1-yangyingliang@huawei.comReviewed-by: default avatarAlexey Gladkov <legion@kernel.org>
Signed-off-by: default avatarEric W. Biederman <ebiederm@xmission.com>
parent f928ef68
......@@ -372,7 +372,8 @@ int copy_creds(struct task_struct *p, unsigned long clone_flags)
ret = create_user_ns(new);
if (ret < 0)
goto error_put;
if (set_cred_ucounts(new) < 0)
ret = set_cred_ucounts(new);
if (ret < 0)
goto error_put;
}
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment