Print this page
patch cleanup
6659 nvlist_free(NULL) is a no-op

@@ -21,12 +21,10 @@
 /*
  * Copyright 2007 Sun Microsystems, Inc.  All rights reserved.
  * Use is subject to license terms.
  */
 
-#pragma ident   "%Z%%M% %I%     %E% SMI"
-
 #include "librcm_impl.h"
 #include "librcm_event.h"
 
 #ifdef  DEBUG
 static int rcm_debug = 1;

@@ -543,11 +541,10 @@
 rcm_free_info(rcm_info_t *info)
 {
         while (info) {
                 rcm_info_t *tmp = info->next;
 
-                if (info->info)
                         nvlist_free(info->info);
                 free(info);
 
                 info = tmp;
         }

@@ -1258,11 +1255,10 @@
         }
 
 out:
         if (nvl_packed)
                 free(nvl_packed);
-        if (ret)
                 nvlist_free(ret);
         dprintf((stderr, "daemon call is done. error = %d, errno = %s\n", error,
             strerror(errno)));
         return (error);
 }

@@ -1448,11 +1444,10 @@
         return (0);
 
 fail:
         if (buf)
                 free(buf);
-        if (nvl)
                 nvlist_free(nvl);
         if (*nvl_packed)
                 free(*nvl_packed);
         *nvl_packed = NULL;
         *nvl_size = 0;