mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-29 03:01:39 -04:00
sysvipc: duplicate lock comments wrt ipc_addid()
The comment in msgqueues when using ipc_addid() is quite useful imo. Duplicate it for shm and semaphores. Link: http://lkml.kernel.org/r/[email protected] Signed-off-by: Davidlohr Bueso <[email protected]> Cc: Manfred Spraul <[email protected]> Signed-off-by: Andrew Morton <[email protected]> Signed-off-by: Linus Torvalds <[email protected]>
This commit is contained in:
parent
b8fd998384
commit
39c96a1b96
2 changed files with 2 additions and 0 deletions
|
|
@ -515,6 +515,7 @@ static int newary(struct ipc_namespace *ns, struct ipc_params *params)
|
|||
sma->sem_nsems = nsems;
|
||||
sma->sem_ctime = ktime_get_real_seconds();
|
||||
|
||||
/* ipc_addid() locks sma upon success. */
|
||||
retval = ipc_addid(&sem_ids(ns), &sma->sem_perm, ns->sc_semmni);
|
||||
if (retval < 0) {
|
||||
call_rcu(&sma->sem_perm.rcu, sem_rcu_free);
|
||||
|
|
|
|||
|
|
@ -601,6 +601,7 @@ static int newseg(struct ipc_namespace *ns, struct ipc_params *params)
|
|||
shp->shm_file = file;
|
||||
shp->shm_creator = current;
|
||||
|
||||
/* ipc_addid() locks shp upon success. */
|
||||
error = ipc_addid(&shm_ids(ns), &shp->shm_perm, ns->shm_ctlmni);
|
||||
if (error < 0)
|
||||
goto no_id;
|
||||
|
|
|
|||
Loading…
Reference in a new issue