]> git.baikalelectronics.ru Git - kernel.git/commit
tree wide: use kvfree() than conditional kfree()/vfree()
authorTetsuo Handa <penguin-kernel@i-love.sakura.ne.jp>
Fri, 22 Jan 2016 23:11:02 +0000 (15:11 -0800)
committerLinus Torvalds <torvalds@linux-foundation.org>
Sat, 23 Jan 2016 01:02:18 +0000 (17:02 -0800)
commited4d50356da042b5c74fcae9cb0d51652054e318
treec644d2e609c3054833710b75ab1d0fe50fb17c01
parent6d842d07f45a91806557dea9ca539f96c19fbcdb
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 <penguin-kernel@I-love.SAKURA.ne.jp>
Acked-by: Michal Hocko <mhocko@suse.com>
Acked-by: Jan Kara <jack@suse.com>
Acked-by: Russell King <rmk+kernel@arm.linux.org.uk>
Reviewed-by: Andreas Dilger <andreas.dilger@intel.com>
Acked-by: "Rafael J. Wysocki" <rjw@rjwysocki.net>
Acked-by: David Rientjes <rientjes@google.com>
Cc: "Luck, Tony" <tony.luck@intel.com>
Cc: Oleg Drokin <oleg.drokin@intel.com>
Cc: Boris Petkov <bp@suse.de>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
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