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


 671 
 672                 if ((chnode = topo_node_bind(mod, pnode, name, i, fmri))
 673                     == NULL) {
 674                         nvlist_free(fmri);
 675                         whinge(mod, &nerr, "amd_dramchan_create: node bind "
 676                             "failed\n");
 677                         continue;
 678                 }
 679 
 680                 (void) topo_node_asru_set(chnode, fmri, 0, &err);
 681                 if (pfmri)
 682                         (void) topo_node_fru_set(chnode, pfmri, 0, &err);
 683 
 684                 nvlist_free(fmri);
 685 
 686                 (void) topo_pgroup_create(chnode, &chan_pgroup, &err);
 687 
 688                 (void) topo_prop_set_string(chnode, PGNAME(CHAN), "channel",
 689                     TOPO_PROP_IMMUTABLE, i == 0 ? "A" : "B", &err);
 690         }
 691         if (pfmri)
 692                 nvlist_free(pfmri);
 693 
 694         return (nerr == 0 ? 0 : -1);
 695 }
 696 
 697 static int
 698 amd_htconfig(topo_mod_t *mod, tnode_t *cnode, nvlist_t *htnvl)
 699 {
 700         nvpair_t *nvp;
 701         int nerr = 0;
 702 
 703         if (strcmp(topo_node_name(cnode), CHIP_NODE_NAME) != 0) {
 704                 whinge(mod, &nerr, "amd_htconfig: must pass a chip node!");
 705                 return (-1);
 706         }
 707 
 708         for (nvp = nvlist_next_nvpair(htnvl, NULL); nvp != NULL;
 709             nvp = nvlist_next_nvpair(htnvl, nvp)) {
 710                 if (nvprop_add(mod, nvp, PGNAME(CHIP), cnode) != 0)
 711                         nerr++;




 671 
 672                 if ((chnode = topo_node_bind(mod, pnode, name, i, fmri))
 673                     == NULL) {
 674                         nvlist_free(fmri);
 675                         whinge(mod, &nerr, "amd_dramchan_create: node bind "
 676                             "failed\n");
 677                         continue;
 678                 }
 679 
 680                 (void) topo_node_asru_set(chnode, fmri, 0, &err);
 681                 if (pfmri)
 682                         (void) topo_node_fru_set(chnode, pfmri, 0, &err);
 683 
 684                 nvlist_free(fmri);
 685 
 686                 (void) topo_pgroup_create(chnode, &chan_pgroup, &err);
 687 
 688                 (void) topo_prop_set_string(chnode, PGNAME(CHAN), "channel",
 689                     TOPO_PROP_IMMUTABLE, i == 0 ? "A" : "B", &err);
 690         }

 691         nvlist_free(pfmri);
 692 
 693         return (nerr == 0 ? 0 : -1);
 694 }
 695 
 696 static int
 697 amd_htconfig(topo_mod_t *mod, tnode_t *cnode, nvlist_t *htnvl)
 698 {
 699         nvpair_t *nvp;
 700         int nerr = 0;
 701 
 702         if (strcmp(topo_node_name(cnode), CHIP_NODE_NAME) != 0) {
 703                 whinge(mod, &nerr, "amd_htconfig: must pass a chip node!");
 704                 return (-1);
 705         }
 706 
 707         for (nvp = nvlist_next_nvpair(htnvl, NULL); nvp != NULL;
 708             nvp = nvlist_next_nvpair(htnvl, nvp)) {
 709                 if (nvprop_add(mod, nvp, PGNAME(CHIP), cnode) != 0)
 710                         nerr++;