altq/cbq: Clear poll-cache if the cached class is to be destroyed
authorSepherosa Ziehau <sephe@dragonflybsd.org>
Wed, 21 Dec 2011 08:09:50 +0000 (16:09 +0800)
committerSepherosa Ziehau <sephe@dragonflybsd.org>
Wed, 21 Dec 2011 08:09:50 +0000 (16:09 +0800)
sys/net/altq/altq_rmclass.c

index fb399d4..d99368f 100644 (file)
@@ -533,6 +533,10 @@ rmc_delete_class(struct rm_ifdat *ifd, struct rm_class *cl)
                callout_stop(&cl->callout_);
 
        crit_enter();
+
+       if (ifd->pollcache_ == cl)
+               ifd->pollcache_ = NULL;
+
        /*
         * Free packets in the packet queue.
         * XXX - this may not be a desired behavior.  Packets should be