kmem_cache_alloc doesn't return ERR_PTR so no need to check for it.
PATCH 1/1 kmem_cache_alloc doesn't return ERR_PTR so no need to check for it.
According to scripts/coccinelle/null/eno.cocci "The various basic memory allocation functions don't return ERR_PTR" so there's no point in calling IS_ERR() on the return value from them, the existing test is good enough.
Signed-off-by Chris Samuel <[email protected]>
--- fs/btrfs/extent_map.c | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-)
fs/btrfs/extent_map.c +1 -1
@@ -50,7 +50,7 @@ struct extent_map *alloc_extent_map(gfp_t mask) {struct extent_map *em; em =kmem_cache_alloc (extent_map_cache, mask); -if (!em ||IS_ERR (em)) +if (!em)return em; em->in_tree =0 ; em->flags =0 ;
Signature · 4 lines
1.7.0.4 -- Chris Samuel : http://www.csamuel.org/ : Melbourne, VIC