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

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);
}