From: Geliang Tang <geliangtang@xxxxxxxxx> Subject: mm/vmalloc.c: use rb_entry_safe Use rb_entry_safe() instead of open-coding it. Link: http://lkml.kernel.org/r/81bb9820e5b9e4a1c596b3e76f88abf8c4a76cb0.1482221947.git.geliangtang@xxxxxxxxx Signed-off-by: Geliang Tang <geliangtang@xxxxxxxxx> Acked-by: Michal Hocko <mhocko@xxxxxxxx> Signed-off-by: Andrew Morton <akpm@xxxxxxxxxxxxxxxxxxxx> --- mm/vmalloc.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff -puN mm/vmalloc.c~mm-vmallocc-use-rb_entry_safe mm/vmalloc.c --- a/mm/vmalloc.c~mm-vmallocc-use-rb_entry_safe +++ a/mm/vmalloc.c @@ -2309,7 +2309,7 @@ EXPORT_SYMBOL_GPL(free_vm_area); #ifdef CONFIG_SMP static struct vmap_area *node_to_va(struct rb_node *n) { - return n ? rb_entry(n, struct vmap_area, rb_node) : NULL; + return rb_entry_safe(n, struct vmap_area, rb_node); } /** _ -- To unsubscribe from this list: send the line "unsubscribe mm-commits" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html