summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--drivers/staging/lustre/lnet/lnet/config.c5
1 files changed, 2 insertions, 3 deletions
diff --git a/drivers/staging/lustre/lnet/lnet/config.c b/drivers/staging/lustre/lnet/lnet/config.c
index e71eea71a1ef..449069c9e649 100644
--- a/drivers/staging/lustre/lnet/lnet/config.c
+++ b/drivers/staging/lustre/lnet/lnet/config.c
@@ -1020,6 +1020,7 @@ lnet_match_networks(char **networksp, char *ip2nets, __u32 *ipaddrs, int nip)
struct list_head *t;
struct list_head *t2;
struct lnet_text_buf *tb;
+ struct lnet_text_buf *temp;
struct lnet_text_buf *tb2;
__u32 net1;
__u32 net2;
@@ -1042,9 +1043,7 @@ lnet_match_networks(char **networksp, char *ip2nets, __u32 *ipaddrs, int nip)
len = 0;
rc = 0;
- while (!list_empty(&raw_entries)) {
- tb = list_entry(raw_entries.next, struct lnet_text_buf,
- ltb_list);
+ list_for_each_entry_safe(tb, temp, &raw_entries, ltb_list) {
strncpy(source, tb->ltb_text, sizeof(source));
source[sizeof(source) - 1] = '\0';