diff options
author | Dong Fang <yp.fangdong@gmail.com> | 2013-09-11 14:19:50 -0700 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2013-09-11 15:56:36 -0700 |
commit | df53cd3b70712cd136f10ef79457623c5c3764a4 (patch) | |
tree | 426988282de0ac3ff6d00a51dc8f299e47dfeefc /fs/ocfs2/dlm/dlmcommon.h | |
parent | 8dd7903e48df3779bc424196c22dc73b66d0643e (diff) | |
download | linux-df53cd3b70712cd136f10ef79457623c5c3764a4.tar.gz linux-df53cd3b70712cd136f10ef79457623c5c3764a4.tar.bz2 linux-df53cd3b70712cd136f10ef79457623c5c3764a4.zip |
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/dlmcommon.h')
-rw-r--r-- | fs/ocfs2/dlm/dlmcommon.h | 4 |
1 files changed, 1 insertions, 3 deletions
diff --git a/fs/ocfs2/dlm/dlmcommon.h b/fs/ocfs2/dlm/dlmcommon.h index de854cca12a2..e0517762fcc0 100644 --- a/fs/ocfs2/dlm/dlmcommon.h +++ b/fs/ocfs2/dlm/dlmcommon.h @@ -1079,11 +1079,9 @@ static inline int dlm_lock_compatible(int existing, int request) static inline int dlm_lock_on_list(struct list_head *head, struct dlm_lock *lock) { - struct list_head *iter; struct dlm_lock *tmplock; - list_for_each(iter, head) { - tmplock = list_entry(iter, struct dlm_lock, list); + list_for_each_entry(tmplock, head, list) { if (tmplock == lock) return 1; } |