1 files changed, 8 insertions, 5 deletions
diff --git a/ipc/util.c b/ipc/util.c
index 3fdfabfdd9c3..b99038699fee 100644
@@ -583,19 +583,22 @@ struct kern_ipc_perm *ipc_lock(struct ipc_ids *ids, int id)
out = ipc_obtain_object_idr(ids, id);
- goto err1;
+ goto err;
- /* ipc_rmid() may have already freed the ID while ipc_lock
- * was spinning: here verify that the structure is still valid
+ * ipc_rmid() may have already freed the ID while ipc_lock()
+ * was spinning: here verify that the structure is still valid.
+ * Upon races with RMID, return -EIDRM, thus indicating that
+ * the ID points to a removed identifier.
- out = ERR_PTR(-EINVAL);
+ out = ERR_PTR(-EIDRM);