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

*** 135,145 **** 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); 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]. --- 135,145 ---- 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)); ! 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,892 **** } 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_inc_32(&tsctp_ill->sctp_ill_ipifcnt); rw_exit(&sctps->sctps_g_ipifs_lock); rw_exit(&sctps->sctps_g_ills_lock); } --- 882,892 ---- } 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); ! 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,1105 **** 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); } } sctp_ipif = kmem_zalloc(sizeof (sctp_ipif_t), KM_NOSLEEP); /* Try again? */ --- 1095,1105 ---- 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)); ! atomic_dec_32(&osctp_ill->sctp_ill_ipifcnt); } } sctp_ipif = kmem_zalloc(sizeof (sctp_ipif_t), KM_NOSLEEP); /* Try again? */
*** 1207,1217 **** 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); 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); --- 1207,1217 ---- 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)); ! 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,2037 **** 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); 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; --- 2027,2037 ---- sctp_ill = sctp_ipif->sctp_ipif_ill; list_remove(&sctps->sctps_g_ipifs[i].sctp_ipif_list, sctp_ipif); sctps->sctps_g_ipifs_count--; ! 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;