Correct IOCTL return code.
Approved by: thompsa (mentor)
This commit is contained in:
parent
428ad0a9c4
commit
ce4092bda4
@ -1456,7 +1456,7 @@ usb_static_ioctl(struct cdev *dev, u_long cmd, caddr_t data, int fflag,
|
|||||||
struct usb_read_dir *urd;
|
struct usb_read_dir *urd;
|
||||||
void* data;
|
void* data;
|
||||||
} u;
|
} u;
|
||||||
int err = ENOTTY;
|
int err;
|
||||||
|
|
||||||
u.data = data;
|
u.data = data;
|
||||||
switch (cmd) {
|
switch (cmd) {
|
||||||
@ -1472,6 +1472,7 @@ usb_static_ioctl(struct cdev *dev, u_long cmd, caddr_t data, int fflag,
|
|||||||
break;
|
break;
|
||||||
case USB_GET_TEMPLATE:
|
case USB_GET_TEMPLATE:
|
||||||
*(int *)data = usb_template;
|
*(int *)data = usb_template;
|
||||||
|
err = 0;
|
||||||
break;
|
break;
|
||||||
case USB_SET_TEMPLATE:
|
case USB_SET_TEMPLATE:
|
||||||
err = priv_check(curthread, PRIV_DRIVER);
|
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;
|
break;
|
||||||
usb_template = *(int *)data;
|
usb_template = *(int *)data;
|
||||||
break;
|
break;
|
||||||
|
default:
|
||||||
|
err = ENOTTY;
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
return (err);
|
return (err);
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user