summaryrefslogtreecommitdiffstats
path: root/fs/ocfs2/dlm/dlmunlock.c
diff options
context:
space:
mode:
authorDong Fang <yp.fangdong@gmail.com>2013-09-11 14:19:50 -0700
committerLinus Torvalds <torvalds@linux-foundation.org>2013-09-11 15:56:36 -0700
commitdf53cd3b70712cd136f10ef79457623c5c3764a4 (patch)
tree426988282de0ac3ff6d00a51dc8f299e47dfeefc /fs/ocfs2/dlm/dlmunlock.c
parent8dd7903e48df3779bc424196c22dc73b66d0643e (diff)
downloadop-kernel-dev-df53cd3b70712cd136f10ef79457623c5c3764a4.zip
op-kernel-dev-df53cd3b70712cd136f10ef79457623c5c3764a4.tar.gz
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.c4
1 files changed, 1 insertions, 3 deletions
diff --git a/fs/ocfs2/dlm/dlmunlock.c b/fs/ocfs2/dlm/dlmunlock.c
index 850aa7e..5698b52 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,
struct dlm_ctxt *dlm = data;
struct dlm_unlock_lock *unlock = (struct dlm_unlock_lock *)msg->buf;
struct dlm_lock_resource *res = NULL;
- struct list_head *iter;
struct dlm_lock *lock = NULL;
enum dlm_status status = DLM_NORMAL;
int found = 0, i;
@@ -458,8 +457,7 @@ int dlm_unlock_lock_handler(struct o2net_msg *msg, u32 len, void *data,
}
for (i=0; i<3; i++) {
- list_for_each(iter, queue) {
- lock = list_entry(iter, struct dlm_lock, list);
+ list_for_each_entry(lock, queue, list) {
if (lock->ml.cookie == unlock->cookie &&
lock->ml.node == unlock->node_idx) {
dlm_lock_get(lock);
OpenPOWER on IntegriCloud