diff options
author | Dong Fang <yp.fangdong@gmail.com> | 2013-09-11 17:19:50 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2013-09-11 18:56:36 -0400 |
commit | df53cd3b70712cd136f10ef79457623c5c3764a4 (patch) | |
tree | 426988282de0ac3ff6d00a51dc8f299e47dfeefc /fs/ocfs2/dlm/dlmunlock.c | |
parent | 8dd7903e48df3779bc424196c22dc73b66d0643e (diff) |
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>
Diffstat (limited to 'fs/ocfs2/dlm/dlmunlock.c')
-rw-r--r-- | fs/ocfs2/dlm/dlmunlock.c | 4 |
1 files changed, 1 insertions, 3 deletions
diff --git a/fs/ocfs2/dlm/dlmunlock.c b/fs/ocfs2/dlm/dlmunlock.c index 850aa7e87537..5698b52cf5c9 100644 --- a/fs/ocfs2/dlm/dlmunlock.c +++ b/fs/ocfs2/dlm/dlmunlock.c | |||
@@ -388,7 +388,6 @@ int dlm_unlock_lock_handler(struct o2net_msg *msg, u32 len, void *data, | |||
388 | struct dlm_ctxt *dlm = data; | 388 | struct dlm_ctxt *dlm = data; |
389 | struct dlm_unlock_lock *unlock = (struct dlm_unlock_lock *)msg->buf; | 389 | struct dlm_unlock_lock *unlock = (struct dlm_unlock_lock *)msg->buf; |
390 | struct dlm_lock_resource *res = NULL; | 390 | struct dlm_lock_resource *res = NULL; |
391 | struct list_head *iter; | ||
392 | struct dlm_lock *lock = NULL; | 391 | struct dlm_lock *lock = NULL; |
393 | enum dlm_status status = DLM_NORMAL; | 392 | enum dlm_status status = DLM_NORMAL; |
394 | int found = 0, i; | 393 | int found = 0, i; |
@@ -458,8 +457,7 @@ int dlm_unlock_lock_handler(struct o2net_msg *msg, u32 len, void *data, | |||
458 | } | 457 | } |
459 | 458 | ||
460 | for (i=0; i<3; i++) { | 459 | for (i=0; i<3; i++) { |
461 | list_for_each(iter, queue) { | 460 | list_for_each_entry(lock, queue, list) { |
462 | lock = list_entry(iter, struct dlm_lock, list); | ||
463 | if (lock->ml.cookie == unlock->cookie && | 461 | if (lock->ml.cookie == unlock->cookie && |
464 | lock->ml.node == unlock->node_idx) { | 462 | lock->ml.node == unlock->node_idx) { |
465 | dlm_lock_get(lock); | 463 | dlm_lock_get(lock); |