1
0
mirror of https://git.FreeBSD.org/src.git synced 2024-12-19 10:53:58 +00:00

Do not dereference NULL scp in the case the screen is not opened.

Instead, return ENXIO to the ioctl caller.

Reported and tested by:	Pawel Worach <pawel.worach gmail com>
Discussed with:	markus
MFC after:	3 days
This commit is contained in:
Konstantin Belousov 2008-01-24 15:37:48 +00:00
parent 623c393d65
commit eee74fe05d
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=175640

View File

@ -1071,6 +1071,8 @@ scioctl(struct cdev *dev, u_long cmd, caddr_t data, int flag, struct thread *td)
if (error)
return error;
scp = sc_get_stat(SC_DEV(sc, i));
if (scp == NULL)
return (ENXIO);
if (scp == scp->sc->cur_scp)
return 0;
error = tsleep(&scp->smode, PZERO | PCATCH, "waitvt", 0);