mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-30 03:27:44 -04:00
ipc: simplify ipc initialization
Now that we know that rhashtable_init() will not fail, we can get rid of a lot of the unnecessary cleanup paths when the call errored out. [[email protected]: variable name added to util.h to resolve checkpatch warning] Link: http://lkml.kernel.org/r/[email protected] Signed-off-by: Davidlohr Bueso <[email protected]> Signed-off-by: Manfred Spraul <[email protected]> Cc: Dmitry Vyukov <[email protected]> Cc: Herbert Xu <[email protected]> Cc: Kees Cook <[email protected]> Cc: Michael Kerrisk <[email protected]> Cc: Michal Hocko <[email protected]> Signed-off-by: Andrew Morton <[email protected]> Signed-off-by: Linus Torvalds <[email protected]>
This commit is contained in:
parent
dc2c8c84de
commit
eae04d25a7
6 changed files with 30 additions and 54 deletions
|
|
@ -55,28 +55,16 @@ static struct ipc_namespace *create_ipc_ns(struct user_namespace *user_ns,
|
|||
ns->user_ns = get_user_ns(user_ns);
|
||||
ns->ucounts = ucounts;
|
||||
|
||||
err = sem_init_ns(ns);
|
||||
if (err)
|
||||
goto fail_put;
|
||||
err = msg_init_ns(ns);
|
||||
if (err)
|
||||
goto fail_destroy_sem;
|
||||
err = shm_init_ns(ns);
|
||||
if (err)
|
||||
goto fail_destroy_msg;
|
||||
|
||||
err = mq_init_ns(ns);
|
||||
if (err)
|
||||
goto fail_destroy_shm;
|
||||
goto fail_put;
|
||||
|
||||
sem_init_ns(ns);
|
||||
msg_init_ns(ns);
|
||||
shm_init_ns(ns);
|
||||
|
||||
return ns;
|
||||
|
||||
fail_destroy_shm:
|
||||
shm_exit_ns(ns);
|
||||
fail_destroy_msg:
|
||||
msg_exit_ns(ns);
|
||||
fail_destroy_sem:
|
||||
sem_exit_ns(ns);
|
||||
fail_put:
|
||||
put_user_ns(ns->user_ns);
|
||||
ns_free_inum(&ns->ns);
|
||||
|
|
|
|||
Loading…
Reference in a new issue