From: Filipe Manana Date: Sat, 13 Jun 2015 05:52:56 +0000 (+0100) Subject: Btrfs: use kmem_cache_free when freeing entry in inode cache X-Git-Tag: v3.2.71~54 X-Git-Url: http://git.openpandora.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=c6bbfa525c51fd10970b7cb0ed295c5e7ee27511;p=pandora-kernel.git Btrfs: use kmem_cache_free when freeing entry in inode cache commit c3f4a1685bb87e59c886ee68f7967eae07d4dffa upstream. The free space entries are allocated using kmem_cache_zalloc(), through __btrfs_add_free_space(), therefore we should use kmem_cache_free() and not kfree() to avoid any confusion and any potential problem. Looking at the kfree() definition at mm/slab.c it has the following comment: /* * (...) * * Don't free memory not originally allocated by kmalloc() * or you will run into trouble. */ So better be safe and use kmem_cache_free(). Signed-off-by: Filipe Manana Reviewed-by: David Sterba Signed-off-by: Chris Mason Signed-off-by: Ben Hutchings --- Reading git-diff-tree failed