projects
/
firefly-linux-kernel-4.4.55.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
| inline |
side by side
IPC: fix error case when idr-cache is empty in ipcget()
[firefly-linux-kernel-4.4.55.git]
/
ipc
/
shm.c
diff --git
a/ipc/shm.c
b/ipc/shm.c
index 05c97c7513c2671b06523dd986b2cc4774dd8345..3818fae625c5252363380fa9c7a521e8b5c1a7d1 100644
(file)
--- a/
ipc/shm.c
+++ b/
ipc/shm.c
@@
-433,10
+433,11
@@
static int newseg(struct ipc_namespace *ns, struct ipc_params *params)
if (IS_ERR(file))
goto no_file;
- error = -ENOSPC;
id = shm_addid(ns, shp);
- if(id == -1)
+ if (id < 0) {
+ error = id;
goto no_id;
+ }
shp->shm_cprid = task_tgid_vnr(current);
shp->shm_lprid = 0;