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

@@ -135,11 +135,11 @@
         sctps->sctps_g_ipifs[hindex].ipif_count--;
         sctps->sctps_g_ipifs_count--;
         rw_destroy(&sctp_ipif->sctp_ipif_lock);
         kmem_free(sctp_ipif, sizeof (sctp_ipif_t));
 
-        (void) atomic_dec_32_nv(&sctp_ill->sctp_ill_ipifcnt);
+        atomic_dec_32(&sctp_ill->sctp_ill_ipifcnt);
         if (rw_tryupgrade(&sctps->sctps_g_ills_lock) != 0) {
                 rw_downgrade(&sctps->sctps_g_ipifs_lock);
                 if (sctp_ill->sctp_ill_ipifcnt == 0 &&
                     sctp_ill->sctp_ill_state == SCTP_ILLS_CONDEMNED) {
                         list_remove(&sctps->sctps_g_ills[ill_index].

@@ -882,11 +882,11 @@
         }
         rw_enter(&sctp_ipif->sctp_ipif_lock, RW_WRITER);
         ASSERT(sctp_ipif->sctp_ipif_ill == fsctp_ill);
         sctp_ipif->sctp_ipif_ill = tsctp_ill;
         rw_exit(&sctp_ipif->sctp_ipif_lock);
-        (void) atomic_dec_32_nv(&fsctp_ill->sctp_ill_ipifcnt);
+        atomic_dec_32(&fsctp_ill->sctp_ill_ipifcnt);
         atomic_inc_32(&tsctp_ill->sctp_ill_ipifcnt);
         rw_exit(&sctps->sctps_g_ipifs_lock);
         rw_exit(&sctps->sctps_g_ills_lock);
 }
 

@@ -1095,11 +1095,11 @@
                         list_remove(ipif_list, (void *)osctp_ipif);
                         sctps->sctps_g_ipifs[ohindex].ipif_count--;
                         sctps->sctps_g_ipifs_count--;
                         rw_destroy(&osctp_ipif->sctp_ipif_lock);
                         kmem_free(osctp_ipif, sizeof (sctp_ipif_t));
-                        (void) atomic_dec_32_nv(&osctp_ill->sctp_ill_ipifcnt);
+                        atomic_dec_32(&osctp_ill->sctp_ill_ipifcnt);
                 }
         }
 
         sctp_ipif = kmem_zalloc(sizeof (sctp_ipif_t), KM_NOSLEEP);
         /* Try again? */

@@ -1207,11 +1207,11 @@
                 list_remove(ipif_list, (void *)sctp_ipif);
                 sctps->sctps_g_ipifs[hindex].ipif_count--;
                 sctps->sctps_g_ipifs_count--;
                 rw_destroy(&sctp_ipif->sctp_ipif_lock);
                 kmem_free(sctp_ipif, sizeof (sctp_ipif_t));
-                (void) atomic_dec_32_nv(&sctp_ill->sctp_ill_ipifcnt);
+                atomic_dec_32(&sctp_ill->sctp_ill_ipifcnt);
                 if (rw_tryupgrade(&sctps->sctps_g_ills_lock) != 0) {
                         rw_downgrade(&sctps->sctps_g_ipifs_lock);
                         if (sctp_ill->sctp_ill_ipifcnt == 0 &&
                             sctp_ill->sctp_ill_state == SCTP_ILLS_CONDEMNED) {
                                 list_remove(ill_list, (void *)sctp_ill);

@@ -2027,11 +2027,11 @@
                         sctp_ill = sctp_ipif->sctp_ipif_ill;
 
                         list_remove(&sctps->sctps_g_ipifs[i].sctp_ipif_list,
                             sctp_ipif);
                         sctps->sctps_g_ipifs_count--;
-                        (void) atomic_dec_32_nv(&sctp_ill->sctp_ill_ipifcnt);
+                        atomic_dec_32(&sctp_ill->sctp_ill_ipifcnt);
                         kmem_free(sctp_ipif, sizeof (sctp_ipif_t));
                         sctp_ipif =
                             list_tail(&sctps->sctps_g_ipifs[i].sctp_ipif_list);
                 }
                 sctps->sctps_g_ipifs[i].ipif_count = 0;