Skip to content

Commit 5e6b8a5

Browse files
Yang Yingliangebiederm
authored andcommitted
cred: add missing return error code when set_cred_ucounts() failed
If set_cred_ucounts() failed, we need return the error code. Fixes: 905ae01 ("Add a reference to ucounts for each cred") Reported-by: Hulk Robot <[email protected]> Signed-off-by: Yang Yingliang <[email protected]> Link: https://lkml.kernel.org/r/[email protected] Reviewed-by: Alexey Gladkov <[email protected]> Signed-off-by: Eric W. Biederman <[email protected]>
1 parent f928ef6 commit 5e6b8a5

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

kernel/cred.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -372,7 +372,8 @@ int copy_creds(struct task_struct *p, unsigned long clone_flags)
372372
ret = create_user_ns(new);
373373
if (ret < 0)
374374
goto error_put;
375-
if (set_cred_ucounts(new) < 0)
375+
ret = set_cred_ucounts(new);
376+
if (ret < 0)
376377
goto error_put;
377378
}
378379

0 commit comments

Comments
 (0)