1
0
mirror of https://git.FreeBSD.org/src.git synced 2024-12-18 10:35:55 +00:00

Do not call knlist_destroy() in tapclose(). Instead call it when device is

actually destroyed. Also move call to knlist_init() into tapcreate(). This
should fix panic described in kern/95357.

PR:			kern/95357
No response from:	freebsd-current@
MFC after:		3 days
This commit is contained in:
Maksim Yevmenkin 2006-05-17 17:05:02 +00:00
parent 5aaacc6632
commit 7a9adfdd85
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=158697

View File

@ -219,6 +219,7 @@ tapmodevent(module_t mod, int type, void *data)
KASSERT(!(tp->tap_flags & TAP_OPEN),
("%s flags is out of sync", ifp->if_xname));
knlist_destroy(&tp->tap_rsel.si_note);
destroy_dev(tp->tap_dev);
s = splimp();
ether_ifdetach(ifp);
@ -354,6 +355,8 @@ tapcreate(struct cdev *dev)
tp->tap_flags |= TAP_INITED;
mtx_unlock(&tp->tap_mtx);
knlist_init(&tp->tap_rsel.si_note, NULL, NULL, NULL, NULL);
TAPDEBUG("interface %s is created. minor = %#x\n",
ifp->if_xname, minor(dev));
} /* tapcreate */
@ -405,8 +408,6 @@ tapopen(struct cdev *dev, int flag, int mode, struct thread *td)
ifp->if_drv_flags &= ~IFF_DRV_OACTIVE;
splx(s);
knlist_init(&tp->tap_rsel.si_note, NULL, NULL, NULL, NULL);
TAPDEBUG("%s is open. minor = %#x\n", ifp->if_xname, minor(dev));
return (0);
@ -459,8 +460,6 @@ tapclose(struct cdev *dev, int foo, int bar, struct thread *td)
tp->tap_pid = 0;
mtx_unlock(&tp->tap_mtx);
knlist_destroy(&tp->tap_rsel.si_note);
TAPDEBUG("%s is closed. minor = %#x\n",
ifp->if_xname, minor(dev));