Print this page
5047 don't use atomic_*_nv if you discard the return value

Split Close
Expand all
Collapse all
          --- old/usr/src/uts/common/io/trill.c
          +++ new/usr/src/uts/common/io/trill.c
↓ open down ↓ 1105 lines elided ↑ open up ↑
1106 1106          kmem_free(nick_entry, sizeof (trill_node_t));
1107 1107  }
1108 1108  
1109 1109  static void
1110 1110  trill_node_unref(trill_inst_t *tip, trill_node_t *tnp)
1111 1111  {
1112 1112          if (atomic_dec_uint_nv(&tnp->tn_refs) == 0) {
1113 1113                  if (tnp->tn_tsp != NULL)
1114 1114                          trill_sock_unref(tnp->tn_tsp);
1115 1115                  trill_node_free(tnp);
1116      -                (void) atomic_dec_uint_nv(&tip->ti_nodecount);
     1116 +                atomic_dec_uint(&tip->ti_nodecount);
1117 1117          }
1118 1118  }
1119 1119  
1120 1120  static trill_node_t *
1121 1121  trill_node_lookup(trill_inst_t *tip, uint16_t nick)
1122 1122  {
1123 1123          trill_node_t *nick_entry;
1124 1124  
1125 1125          if (!VALID_NICK(nick))
1126 1126                  return (NULL);
↓ open down ↓ 557 lines elided ↑ open up ↑
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX