mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-28 01:33:00 -04:00
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 <[email protected]>
Acked-by: Michal Hocko <[email protected]>
Acked-by: Jan Kara <[email protected]>
Acked-by: Russell King <[email protected]>
Reviewed-by: Andreas Dilger <[email protected]>
Acked-by: "Rafael J. Wysocki" <[email protected]>
Acked-by: David Rientjes <[email protected]>
Cc: "Luck, Tony" <[email protected]>
Cc: Oleg Drokin <[email protected]>
Cc: Boris Petkov <[email protected]>
Signed-off-by: Andrew Morton <[email protected]>
Signed-off-by: Linus Torvalds <[email protected]>
This commit is contained in:
parent
eab95db69d
commit
1d5cfdb076
17 changed files with 36 additions and 103 deletions
11
ipc/util.c
11
ipc/util.c
|
|
@ -414,17 +414,12 @@ void *ipc_alloc(int size)
|
|||
/**
|
||||
* ipc_free - free ipc space
|
||||
* @ptr: pointer returned by ipc_alloc
|
||||
* @size: size of block
|
||||
*
|
||||
* Free a block created with ipc_alloc(). The caller must know the size
|
||||
* used in the allocation call.
|
||||
* Free a block created with ipc_alloc().
|
||||
*/
|
||||
void ipc_free(void *ptr, int size)
|
||||
void ipc_free(void *ptr)
|
||||
{
|
||||
if (size > PAGE_SIZE)
|
||||
vfree(ptr);
|
||||
else
|
||||
kfree(ptr);
|
||||
kvfree(ptr);
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
|||
Loading…
Reference in a new issue