mirror of
https://github.com/opnsense/src.git
synced 2026-06-09 08:43:19 -04:00
Fix race in devfs by using LIST_FIRST() instead of
LIST_FOREACH_SAFE() when freeing the devfs private data entries. Reviewed by: kib MFC after: 3 days Approved by: thompsa (mentor)
This commit is contained in:
parent
da52b4caaf
commit
0bad52e1d8
1 changed files with 2 additions and 2 deletions
|
|
@ -926,7 +926,7 @@ static void
|
|||
destroy_devl(struct cdev *dev)
|
||||
{
|
||||
struct cdevsw *csw;
|
||||
struct cdev_privdata *p, *p1;
|
||||
struct cdev_privdata *p;
|
||||
|
||||
mtx_assert(&devmtx, MA_OWNED);
|
||||
KASSERT(dev->si_flags & SI_NAMED,
|
||||
|
|
@ -974,7 +974,7 @@ destroy_devl(struct cdev *dev)
|
|||
dev_unlock();
|
||||
notify_destroy(dev);
|
||||
mtx_lock(&cdevpriv_mtx);
|
||||
LIST_FOREACH_SAFE(p, &cdev2priv(dev)->cdp_fdpriv, cdpd_list, p1) {
|
||||
while ((p = LIST_FIRST(&cdev2priv(dev)->cdp_fdpriv)) != NULL) {
|
||||
devfs_destroy_cdevpriv(p);
|
||||
mtx_lock(&cdevpriv_mtx);
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue