Let knlist_add do the locking part

Remove explicit mtx_lock/mtx_unlock around knlist_add and pass 0 as
locked parameter so knlist_add does the locking itself

Suggested by:	kib@
This commit is contained in:
Oleksandr Tymoshenko 2016-09-06 19:36:28 +00:00
parent db4b3cdad8
commit a4554c3736
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=305492

View File

@ -310,9 +310,7 @@ ti_pruss_kqfilter(struct cdev *cdev, struct knote *kn)
case EVFILT_READ:
kn->kn_hook = sc;
kn->kn_fop = &ti_pruss_kq_read;
mtx_lock(&sc->sc_mtx);
knlist_add(&sc->sc_selinfo.si_note, kn, 1);
mtx_unlock(&sc->sc_mtx);
knlist_add(&sc->sc_selinfo.si_note, kn, 0);
break;
default:
return (EINVAL);