diff options
| author | Rafael J. Wysocki <[email protected]> | 2015-10-09 22:13:30 +0200 | 
|---|---|---|
| committer | Rafael J. Wysocki <[email protected]> | 2015-10-09 22:13:30 +0200 | 
| commit | 670aee3fc7ac37ae947f8b582d87b51d5fa36524 (patch) | |
| tree | 9885998483d4506208e5aef9c13c8a86adea20bb /ipc/shm.c | |
| parent | d61e87ac53292a3138b4354b687558973686b6ca (diff) | |
| parent | 55582bccdc1e89ecc973c260d46e247df675d4df (diff) | |
Merge branches 'pm-devfreq' and 'pm-cpufreq'
* pm-devfreq:
  PM / devfreq: fix double kfree
  PM / devfreq: Fix governor_store()
* pm-cpufreq:
  cpufreq: prevent lockup on reading scaling_available_frequencies
  cpufreq: acpi_cpufreq: prevent crash on reading freqdomain_cpus
Diffstat (limited to 'ipc/shm.c')
| -rw-r--r-- | ipc/shm.c | 13 | 
1 files changed, 7 insertions, 6 deletions
| diff --git a/ipc/shm.c b/ipc/shm.c index 222131e8e38f..41787276e141 100644 --- a/ipc/shm.c +++ b/ipc/shm.c @@ -551,12 +551,6 @@ static int newseg(struct ipc_namespace *ns, struct ipc_params *params)  	if (IS_ERR(file))  		goto no_file; -	id = ipc_addid(&shm_ids(ns), &shp->shm_perm, ns->shm_ctlmni); -	if (id < 0) { -		error = id; -		goto no_id; -	} -  	shp->shm_cprid = task_tgid_vnr(current);  	shp->shm_lprid = 0;  	shp->shm_atim = shp->shm_dtim = 0; @@ -565,6 +559,13 @@ static int newseg(struct ipc_namespace *ns, struct ipc_params *params)  	shp->shm_nattch = 0;  	shp->shm_file = file;  	shp->shm_creator = current; + +	id = ipc_addid(&shm_ids(ns), &shp->shm_perm, ns->shm_ctlmni); +	if (id < 0) { +		error = id; +		goto no_id; +	} +  	list_add(&shp->shm_clist, ¤t->sysvshm.shm_clist);  	/* |