Print this page
6447 handful of nvpair cleanups

@@ -1623,10 +1623,12 @@
                 *ep = NULL;
 
         if ((nvl == NULL) || (name == NULL))
                 return (EINVAL);
 
+        sepp = NULL;
+        idx = 0;
         /* step through components of name */
         for (np = name; np && *np; np = sepp) {
                 /* ensure unique names */
                 if (!(nvl->nvl_nvflag & NV_UNIQUE_NAME))
                         return (ENOTSUP);

@@ -2380,11 +2382,11 @@
          * will be to remove the kmflag from nvlist_pack(), but we will
          * not change the interface.
          */
         nv_priv_init(&nvpriv, nva, 0);
 
-        if (err = nvlist_size(nvl, &alloc_size, encoding))
+        if ((err = nvlist_size(nvl, &alloc_size, encoding)))
                 return (err);
 
         if ((buf = nv_mem_zalloc(&nvpriv, alloc_size)) == NULL)
                 return (ENOMEM);