Whamcloud - gitweb
LU-9859 lnet: move ioctl device to lnet
[fs/lustre-release.git] / libcfs / libcfs / util / string.c
index ce96090..f957db6 100644 (file)
@@ -27,7 +27,6 @@
  */
 /*
  * This file is part of Lustre, http://www.lustre.org/
- * Lustre is a trademark of Sun Microsystems, Inc.
  *
  * String manipulation functions.
  *
@@ -85,6 +84,7 @@ cfs_gettok(struct cfs_lstr *next, char delim, struct cfs_lstr *res)
                /* there is no the delimeter in the string */
                end = next->ls_str + next->ls_len;
                next->ls_str = NULL;
+               next->ls_len = 0;
        } else {
                next->ls_str = end + 1;
                next->ls_len -= (end - res->ls_str + 1);
@@ -438,8 +438,8 @@ cfs_expr_list_free_list(struct list_head *list)
        struct cfs_expr_list *el;
 
        while (!list_empty(list)) {
-               el = list_entry(list->next,
-                                   struct cfs_expr_list, el_link);
+               el = list_first_entry(list,
+                                     struct cfs_expr_list, el_link);
                list_del(&el->el_link);
                cfs_expr_list_free(el);
        }