tree wide: use kvfree() than conditional kfree()/vfree()
authorTetsuo Handa <[email protected]>
Fri, 22 Jan 2016 23:11:02 +0000 (15:11 -0800)
committerLinus Torvalds <[email protected]>
Sat, 23 Jan 2016 01:02:18 +0000 (17:02 -0800)
commit1d5cfdb076288df5eb95545a547a39905e95c930
treec644d2e609c3054833710b75ab1d0fe50fb17c01
parenteab95db69d334745d3034072f4a7204084136c88
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]>
17 files changed:
arch/arm/mm/dma-mapping.c
drivers/acpi/apei/erst.c
drivers/block/drbd/drbd_bitmap.c
drivers/block/drbd/drbd_int.h
drivers/char/mspec.c
drivers/gpu/drm/drm_hashtab.c
drivers/staging/lustre/include/linux/libcfs/libcfs_private.h
fs/coda/coda_linux.h
fs/jffs2/build.c
fs/jffs2/fs.c
fs/jffs2/super.c
fs/udf/super.c
ipc/sem.c
ipc/util.c
ipc/util.h
mm/percpu.c
net/ipv4/fib_trie.c