]> CyberLeo.Net >> Repos - FreeBSD/stable/10.git/commit
MFC r290140:
authorhselasky <hselasky@ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f>
Thu, 12 Nov 2015 08:47:10 +0000 (08:47 +0000)
committerhselasky <hselasky@ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f>
Thu, 12 Nov 2015 08:47:10 +0000 (08:47 +0000)
commit2985c937fd6e081e3c41861745496f7113a250b6
treec9e024dafa7346f8c483c39d77ee3e223863a1ef
parent8b0c18b60c18b30b8c54eab56c0a0137da0c58a8
MFC r290140:
Add missing NULL check in physio().

When destroying a character device the si_devsw field is set to NULL
before all references are gone, to indicate the character device is
going away. This can cause a NULL-dereference fault inside physio().

The callers of physio() should own a thread reference on the cdev and
if si_devsw is seen as non-NULL, it is usable during the execution of
the function. Else an ENXIO error code is returned.

Reviewed by: kib

git-svn-id: svn://svn.freebsd.org/base/stable/10@290705 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f
sys/kern/kern_physio.c