path: root/ipc/util.h
diff options
authorTetsuo Handa <>2016-01-22 15:11:02 -0800
committerLinus Torvalds <>2016-01-22 17:02:18 -0800
commit1d5cfdb076288df5eb95545a547a39905e95c930 (patch)
treec644d2e609c3054833710b75ab1d0fe50fb17c01 /ipc/util.h
parenteab95db69d334745d3034072f4a7204084136c88 (diff)
tree wide: use kvfree() than conditional kfree()/vfree()
There are many locations that do if (memory_was_allocated_by_vmalloc) vfree(ptr); else kfree(ptr); but kvfree() can handle both kmalloc()ed memory and vmalloc()ed memory using is_vmalloc_addr(). Unless callers have special reasons, we can replace this branch with kvfree(). Please check and reply if you found problems. Signed-off-by: Tetsuo Handa <> Acked-by: Michal Hocko <> Acked-by: Jan Kara <> Acked-by: Russell King <> Reviewed-by: Andreas Dilger <> Acked-by: "Rafael J. Wysocki" <> Acked-by: David Rientjes <> Cc: "Luck, Tony" <> Cc: Oleg Drokin <> Cc: Boris Petkov <> Signed-off-by: Andrew Morton <> Signed-off-by: Linus Torvalds <>
Diffstat (limited to 'ipc/util.h')
1 files changed, 1 insertions, 1 deletions
diff --git a/ipc/util.h b/ipc/util.h
index 3a8a5a0eca62..51f7ca58ac67 100644
--- a/ipc/util.h
+++ b/ipc/util.h
@@ -118,7 +118,7 @@ int ipcperms(struct ipc_namespace *ns, struct kern_ipc_perm *ipcp, short flg);
* both function can sleep
void *ipc_alloc(int size);
-void ipc_free(void *ptr, int size);
+void ipc_free(void *ptr);
* For allocation that need to be freed by RCU.