From: Xue jiufei Date: Wed, 3 Jul 2013 22:01:10 +0000 (-0700) Subject: ocfs2: fix NULL pointer dereference when traversing o2hb_all_regions X-Git-Tag: omap-for-v3.11/fixes-for-merge-window~17^2~420 X-Git-Url: http://git.openpandora.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=4a184b4ff424e544359f081087723fc36efe603e;p=pandora-kernel.git ocfs2: fix NULL pointer dereference when traversing o2hb_all_regions There may exist NULL pointer dereference in config_item_name() when one volume (say Volume A) unmounts while another (say Volume B) mounting. Volume A Volume B already Mounted. Unmounting, call o2hb_heartbeat_group_drop_item() -> config_item_put(item) set reg(A)->item.ci_name to NULL in function config_item_cleanup(). begin mounting, call o2hb_region_pin() and tranverse all regions. When reading reg(A)->item.ci_name, it causes NULL pointer dereference. call o2hb_region_release() and del reg(A) from list. So we should skip accessing regions that is going to release when tranverse o2hb_all_regions. Signed-off-by: Yiwen Jiang Signed-off-by: joyce Acked-by: Joel Becker Cc: Mark Fasheh Cc: Sunil Mushran Cc: Jie Liu Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds --- Reading git-diff-tree failed