ocfs2: use list_for_each_entry() instead of list_for_each()
[dan.carpenter@oracle.com: fix up some NULL dereference bugs] Signed-off-by: Dong Fang <yp.fangdong@gmail.com> Cc: Mark Fasheh <mfasheh@suse.com> Cc: Joel Becker <jlbec@evilplan.org> Cc: Jeff Liu <jeff.liu@oracle.com> Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
This commit is contained in:
@@ -292,7 +292,7 @@ int dlm_proxy_ast_handler(struct o2net_msg *msg, u32 len, void *data,
|
||||
struct dlm_lock *lock = NULL;
|
||||
struct dlm_proxy_ast *past = (struct dlm_proxy_ast *) msg->buf;
|
||||
char *name;
|
||||
struct list_head *iter, *head=NULL;
|
||||
struct list_head *head = NULL;
|
||||
__be64 cookie;
|
||||
u32 flags;
|
||||
u8 node;
|
||||
@@ -373,8 +373,7 @@ int dlm_proxy_ast_handler(struct o2net_msg *msg, u32 len, void *data,
|
||||
/* try convert queue for both ast/bast */
|
||||
head = &res->converting;
|
||||
lock = NULL;
|
||||
list_for_each(iter, head) {
|
||||
lock = list_entry (iter, struct dlm_lock, list);
|
||||
list_for_each_entry(lock, head, list) {
|
||||
if (lock->ml.cookie == cookie)
|
||||
goto do_ast;
|
||||
}
|
||||
@@ -385,8 +384,7 @@ int dlm_proxy_ast_handler(struct o2net_msg *msg, u32 len, void *data,
|
||||
else
|
||||
head = &res->granted;
|
||||
|
||||
list_for_each(iter, head) {
|
||||
lock = list_entry (iter, struct dlm_lock, list);
|
||||
list_for_each_entry(lock, head, list) {
|
||||
if (lock->ml.cookie == cookie)
|
||||
goto do_ast;
|
||||
}
|
||||
|
مرجع در شماره جدید
Block a user