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

Split Close
Expand all
Collapse all
          --- old/usr/src/uts/common/os/evchannels.c
          +++ new/usr/src/uts/common/os/evchannels.c
↓ open down ↓ 1156 lines elided ↑ open up ↑
1157 1157              (chp->ch_nevents == 0 || chp->ch_holdpend != CH_HOLD_PEND_INDEF)) {
1158 1158                  /*
1159 1159                   * No more bindings and no persistent subscriber(s).  If there
1160 1160                   * are no events in the channel then destroy the channel;
1161 1161                   * otherwise destroy the channel only if we're not holding
1162 1162                   * pending events indefinitely.
1163 1163                   */
1164 1164                  mutex_exit(&chp->ch_mutex);
1165 1165                  evch_dl_del(&eg->evch_list, &chp->ch_link);
1166 1166                  evch_evq_destroy(chp->ch_queue);
1167      -                if (chp->ch_propnvl)
1168      -                        nvlist_free(chp->ch_propnvl);
     1167 +                nvlist_free(chp->ch_propnvl);
1169 1168                  mutex_destroy(&chp->ch_mutex);
1170 1169                  mutex_destroy(&chp->ch_pubmx);
1171 1170                  cv_destroy(&chp->ch_pubcv);
1172 1171                  kmem_free(chp->ch_name, chp->ch_namelen);
1173 1172                  kmem_free(chp, sizeof (evch_chan_t));
1174 1173          } else
1175 1174                  mutex_exit(&chp->ch_mutex);
1176 1175          mutex_exit(&eg->evch_list_lock);
1177 1176  }
1178 1177  
↓ open down ↓ 386 lines elided ↑ open up ↑
1565 1564          return (chdlen + buflen);
1566 1565  }
1567 1566  
1568 1567  static void
1569 1568  evch_chsetpropnvl(evch_bind_t *bp, nvlist_t *nvl)
1570 1569  {
1571 1570          evch_chan_t *chp = bp->bd_channel;
1572 1571  
1573 1572          mutex_enter(&chp->ch_mutex);
1574 1573  
1575      -        if (chp->ch_propnvl)
1576      -                nvlist_free(chp->ch_propnvl);
     1574 +        nvlist_free(chp->ch_propnvl);
1577 1575  
1578 1576          chp->ch_propnvl = nvl;
1579 1577          chp->ch_propnvlgen++;
1580 1578  
1581 1579          mutex_exit(&chp->ch_mutex);
1582 1580  }
1583 1581  
1584 1582  static int
1585 1583  evch_chgetpropnvl(evch_bind_t *bp, nvlist_t **nvlp, int64_t *genp)
1586 1584  {
↓ open down ↓ 760 lines elided ↑ open up ↑
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX