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


  54                 goto out;
  55         }
  56         rc = nvlist_add_string(attr_list, "messagevalue", trap_messages);
  57         if (rc != 0) {
  58                 goto out;
  59         }
  60         rc = nvlist_add_int32(attr_list, "errorno", errorno);
  61         if (rc != 0) {
  62                 goto out;
  63         }
  64         if (strcmp(driver_name, "sdbc") == 0)
  65                 rc = ddi_log_sysevent(info_dip, DDI_VENDOR_SUNW,
  66                     SVE_CACHE_CLASS, component, attr_list, NULL, DDI_SLEEP);
  67         else if (strcmp(driver_name, "ste") == 0)
  68                 rc = ddi_log_sysevent(info_dip, DDI_VENDOR_SUNW,
  69                     SVE_STE_CLASS, component, attr_list, NULL, DDI_SLEEP);
  70         else if (strcmp(driver_name, "ii") == 0)
  71                 rc = ddi_log_sysevent(info_dip, DDI_VENDOR_SUNW,
  72                     SVE_II_CLASS, component, attr_list, NULL, DDI_SLEEP);
  73 out:
  74         if (attr_list)
  75                 nvlist_free(attr_list);
  76 
  77         if (rc != 0) {
  78                 cmn_err(CE_WARN, "!%s: unable to log sysevent %d:%s and %d",
  79                     driver_name, errorno, trap_messages, alertlevel);
  80         }
  81 #endif  /* which O/S? */
  82 }


  54                 goto out;
  55         }
  56         rc = nvlist_add_string(attr_list, "messagevalue", trap_messages);
  57         if (rc != 0) {
  58                 goto out;
  59         }
  60         rc = nvlist_add_int32(attr_list, "errorno", errorno);
  61         if (rc != 0) {
  62                 goto out;
  63         }
  64         if (strcmp(driver_name, "sdbc") == 0)
  65                 rc = ddi_log_sysevent(info_dip, DDI_VENDOR_SUNW,
  66                     SVE_CACHE_CLASS, component, attr_list, NULL, DDI_SLEEP);
  67         else if (strcmp(driver_name, "ste") == 0)
  68                 rc = ddi_log_sysevent(info_dip, DDI_VENDOR_SUNW,
  69                     SVE_STE_CLASS, component, attr_list, NULL, DDI_SLEEP);
  70         else if (strcmp(driver_name, "ii") == 0)
  71                 rc = ddi_log_sysevent(info_dip, DDI_VENDOR_SUNW,
  72                     SVE_II_CLASS, component, attr_list, NULL, DDI_SLEEP);
  73 out:

  74         nvlist_free(attr_list);
  75 
  76         if (rc != 0) {
  77                 cmn_err(CE_WARN, "!%s: unable to log sysevent %d:%s and %d",
  78                     driver_name, errorno, trap_messages, alertlevel);
  79         }
  80 #endif  /* which O/S? */
  81 }