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

Split Close
Expand all
Collapse all
          --- old/usr/src/cmd/devfsadm/devfsadm.c
          +++ new/usr/src/cmd/devfsadm/devfsadm.c
↓ open down ↓ 8282 lines elided ↑ open up ↑
8283 8283                                          prop_name = "";
8284 8284                                  err_print(PROP_ADD_FAILED, prop_name);
8285 8285                                  goto out;
8286 8286                          }
8287 8287                  }
8288 8288          }
8289 8289  
8290 8290          return (nvl);
8291 8291  
8292 8292  out:
8293      -        if (nvl)
8294      -                nvlist_free(nvl);
     8293 +        nvlist_free(nvl);
8295 8294  
8296 8295          if (dev_name)
8297 8296                  free(dev_name);
8298 8297  
8299 8298          if (dev_name_lookup_err) {
8300 8299                  /*
8301 8300                   * If a lofi mount fails, the /devices node may well have
8302 8301                   * disappeared by the time we run, so let's not complain.
8303 8302                   */
8304 8303                  if (strcmp(subclass, ESC_LOFI) != 0)
↓ open down ↓ 52 lines elided ↑ open up ↑
8357 8356  
8358 8357                  vprint(CHATTY_MID, "sending queued event: %s, %s\n",
8359 8358                      tmp->class, tmp->subclass);
8360 8359  
8361 8360                  log_event(tmp->class, tmp->subclass, tmp->nvl);
8362 8361  
8363 8362                  if (tmp->class != NULL)
8364 8363                          free(tmp->class);
8365 8364                  if (tmp->subclass != NULL)
8366 8365                          free(tmp->subclass);
8367      -                if (tmp->nvl != NULL)
8368      -                        nvlist_free(tmp->nvl);
     8366 +                nvlist_free(tmp->nvl);
8369 8367                  syseventq_back = syseventq_back->next;
8370 8368                  if (syseventq_back == NULL)
8371 8369                          syseventq_front = NULL;
8372 8370                  free(tmp);
8373 8371          }
8374 8372          (void) mutex_unlock(&syseventq_mutex);
8375 8373  }
8376 8374  
8377 8375  static void
8378 8376  build_and_enq_event(char *class, char *subclass, char *node_path,
↓ open down ↓ 362 lines elided ↑ open up ↑
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX