mirror of
https://git.FreeBSD.org/src.git
synced 2025-01-13 14:40:22 +00:00
Make sure we look at the correct sub op codes when
deciding whether it's an operation we can perform via the control device. PR: kern/72010 MFC after: 1 week
This commit is contained in:
parent
cd6640869b
commit
e3e16e9998
Notes:
svn2git
2020-12-20 02:59:44 +00:00
svn path=/head/; revision=145050
@ -810,10 +810,29 @@ saioctl(struct cdev *dev, u_long cmd, caddr_t arg, int flag, struct thread *td)
|
||||
}
|
||||
break;
|
||||
|
||||
case MTIOCTOP:
|
||||
{
|
||||
struct mtop *mt = (struct mtop *) arg;
|
||||
|
||||
/*
|
||||
* Check to make sure it's an OP we can perform
|
||||
* with no media inserted.
|
||||
*/
|
||||
switch (mt->mt_op) {
|
||||
case MTSETBSIZ:
|
||||
case MTSETDNSTY:
|
||||
case MTCOMP:
|
||||
mt = NULL;
|
||||
/* FALLTHROUGH */
|
||||
default:
|
||||
break;
|
||||
}
|
||||
if (mt != NULL) {
|
||||
break;
|
||||
}
|
||||
/* FALLTHROUGH */
|
||||
}
|
||||
case MTIOCSETEOTMODEL:
|
||||
case MTSETBSIZ:
|
||||
case MTSETDNSTY:
|
||||
case MTCOMP:
|
||||
/*
|
||||
* We need to acquire the peripheral here rather
|
||||
* than at open time because we are sharing writable
|
||||
|
Loading…
Reference in New Issue
Block a user