Assert that the linkage between struct cdev_privdata and and struct

file is consistent.

Tested by:	pho
Sponsored by:	The FreeBSD Foundation
MFC after:	2 weeks
This commit is contained in:
Konstantin Belousov 2016-01-17 08:34:35 +00:00
parent b60ff8405f
commit aeace3c33c

View File

@ -185,6 +185,8 @@ devfs_destroy_cdevpriv(struct cdev_privdata *p)
{
mtx_assert(&cdevpriv_mtx, MA_OWNED);
KASSERT(p->cdpd_fp->f_cdevpriv == p,
("devfs_destoy_cdevpriv %p != %p", p->cdpd_fp->f_cdevpriv, p));
p->cdpd_fp->f_cdevpriv = NULL;
LIST_REMOVE(p, cdpd_list);
mtx_unlock(&cdevpriv_mtx);