Skip to content

Commit c3f6fb6

Browse files
keestorvalds
authored andcommitted
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 <keescook@chromium.org> Signed-off-by: Manfred Spraul <manfred@colorfullife.com> Cc: Kees Cook <keescook@chromium.org> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
1 parent 52f9089 commit c3f6fb6

2 files changed

Lines changed: 0 additions & 24 deletions

File tree

‎ipc/util.c‎

Lines changed: 0 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -394,27 +394,6 @@ void ipc_rmid(struct ipc_ids *ids, struct kern_ipc_perm *ipcp)
394394
ipcp->deleted = true;
395395
}
396396

397-
/**
398-
* ipc_rcu_alloc - allocate ipc space
399-
* @size: size desired
400-
*
401-
* Allocate memory for an ipc object.
402-
* The first member must be struct kern_ipc_perm.
403-
*/
404-
struct kern_ipc_perm *ipc_rcu_alloc(int size)
405-
{
406-
/*
407-
* We prepend the allocation with the rcu struct
408-
*/
409-
struct kern_ipc_perm *out = kvmalloc(size, GFP_KERNEL);
410-
if (unlikely(!out))
411-
return NULL;
412-
413-
memset(out, 0, size);
414-
atomic_set(&out->refcount, 1);
415-
return out;
416-
}
417-
418397
int ipc_rcu_getref(struct kern_ipc_perm *ptr)
419398
{
420399
return atomic_inc_not_zero(&ptr->refcount);

‎ipc/util.h‎

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -112,10 +112,7 @@ int ipcperms(struct ipc_namespace *ns, struct kern_ipc_perm *ipcp, short flg);
112112
* Objects are reference counted, they start with reference count 1.
113113
* getref increases the refcount, the putref call that reduces the recount
114114
* to 0 schedules the rcu destruction. Caller must guarantee locking.
115-
*
116-
* struct kern_ipc_perm must be the first member in the allocated structure.
117115
*/
118-
struct kern_ipc_perm *ipc_rcu_alloc(int size);
119116
int ipc_rcu_getref(struct kern_ipc_perm *ptr);
120117
void ipc_rcu_putref(struct kern_ipc_perm *ptr,
121118
void (*func)(struct rcu_head *head));

0 commit comments

Comments
 (0)