1
0
mirror of https://git.FreeBSD.org/src.git synced 2024-11-25 07:49:18 +00:00

Correct IOCTL return code.

Approved by:    thompsa (mentor)
This commit is contained in:
Hans Petter Selasky 2010-10-04 22:04:22 +00:00
parent 428ad0a9c4
commit ce4092bda4
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=213431

View File

@ -1456,7 +1456,7 @@ usb_static_ioctl(struct cdev *dev, u_long cmd, caddr_t data, int fflag,
struct usb_read_dir *urd;
void* data;
} u;
int err = ENOTTY;
int err;
u.data = data;
switch (cmd) {
@ -1472,6 +1472,7 @@ usb_static_ioctl(struct cdev *dev, u_long cmd, caddr_t data, int fflag,
break;
case USB_GET_TEMPLATE:
*(int *)data = usb_template;
err = 0;
break;
case USB_SET_TEMPLATE:
err = priv_check(curthread, PRIV_DRIVER);
@ -1479,6 +1480,9 @@ usb_static_ioctl(struct cdev *dev, u_long cmd, caddr_t data, int fflag,
break;
usb_template = *(int *)data;
break;
default:
err = ENOTTY;
break;
}
return (err);
}