Skip to contentSkip to conversation

ipc/util: drop ipc_rcu_alloc()

PATCH New [email protected] 1 participant 1 message Jul 12, 2017

lore
Share & tools
lore
#0 lore raw

PATCH 43/96 ipc/util: drop ipc_rcu_alloc()

From: Kees Cook <[email protected]>
Subject: ipc/util: drop ipc_rcu_alloc()

No callers remain for ipc_rcu_alloc(). Drop the function.

[[email protected]: Rediff because the memset was temporarily inside ipc_rcu_free()]
Cc Kees Cook <[email protected]>

---

 ipc/util.c |   21 ---------------------
 ipc/util.h |    3 ---
 2 files changed, 24 deletions(-)
ipc/util.c renamed from ipc/util.c~ipc-util-drop-ipc_rcu_alloc +0 -20
diff -puN ipc/util.c~ipc-util-drop-ipc_rcu_alloc ipc/util.c
@@ -394,27 +394,6 @@ void ipc_rmid(struct ipc_ids *ids, struc
 	ipcp->deleted = true;
 }
 
-/**
- * ipc_rcu_alloc - allocate ipc space
- * @size: size desired
- *
- * Allocate memory for an ipc object.
- * The first member must be struct kern_ipc_perm.
- */
-struct kern_ipc_perm *ipc_rcu_alloc(int size)
-{
-	/*
-	 * We prepend the allocation with the rcu struct
-	 */
-	struct kern_ipc_perm *out = kvmalloc(size, GFP_KERNEL);
-	if (unlikely(!out))
-		return NULL;
-
-	memset(out, 0, size);
-	atomic_set(&out->refcount, 1);
-	return out;
-}