From c3f6fb6fe4e638a58eae558cb209c463cd46c2fc Mon Sep 17 00:00:00 2001 From: Kees Cook Date: Wed, 12 Jul 2017 14:35:10 -0700 Subject: ipc/util: drop ipc_rcu_alloc() No callers remain for ipc_rcu_alloc(). Drop the function. [manfred@colorfullife.com: Rediff because the memset was temporarily inside ipc_rcu_free()] Link: http://lkml.kernel.org/r/20170525185107.12869-13-manfred@colorfullife.com Signed-off-by: Kees Cook Signed-off-by: Manfred Spraul Cc: Kees Cook Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds --- ipc/util.c | 21 --------------------- 1 file changed, 21 deletions(-) (limited to 'ipc/util.c') diff --git a/ipc/util.c b/ipc/util.c index 556884bab698..2428dd44ca97 100644 --- a/ipc/util.c +++ b/ipc/util.c @@ -394,27 +394,6 @@ void ipc_rmid(struct ipc_ids *ids, struct kern_ipc_perm *ipcp) 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; -} - int ipc_rcu_getref(struct kern_ipc_perm *ptr) { return atomic_inc_not_zero(&ptr->refcount); -- cgit v1.2.3-59-g8ed1b