svn commit: r273555 - head/sys/kern

Mateusz Guzik mjg at FreeBSD.org
Thu Oct 23 19:06:09 UTC 2014


Author: mjg
Date: Thu Oct 23 19:06:08 2014
New Revision: 273555
URL: https://svnweb.freebsd.org/changeset/base/273555

Log:
  In selfdfree re-evaulate sf_si after takin the lock.
  
  Otherwise we can race with doselwakeup.
  
  This is a fixup to r273549
  
  Reviewed by:	jhb
  Reported by:	everyone and their dog

Modified:
  head/sys/kern/sys_generic.c

Modified: head/sys/kern/sys_generic.c
==============================================================================
--- head/sys/kern/sys_generic.c	Thu Oct 23 18:50:44 2014	(r273554)
+++ head/sys/kern/sys_generic.c	Thu Oct 23 19:06:08 2014	(r273555)
@@ -1602,7 +1602,8 @@ selfdfree(struct seltd *stp, struct self
 	STAILQ_REMOVE(&stp->st_selq, sfp, selfd, sf_link);
 	if (sfp->sf_si != NULL) {
 		mtx_lock(sfp->sf_mtx);
-		TAILQ_REMOVE(&sfp->sf_si->si_tdlist, sfp, sf_threads);
+		if (sfp->sf_si != NULL)
+			TAILQ_REMOVE(&sfp->sf_si->si_tdlist, sfp, sf_threads);
 		mtx_unlock(sfp->sf_mtx);
 	}
 	uma_zfree(selfd_zone, sfp);


More information about the svn-src-head mailing list