patch-2.4.0-test10 linux/drivers/usb/devio.c
Next file: linux/drivers/usb/hub.c
Previous file: linux/drivers/usb/dc2xx.c
Back to the patch index
Back to the overall index
- Lines: 20
- Date:
Mon Oct 9 14:23:49 2000
- Orig file:
v2.4.0-test9/linux/drivers/usb/devio.c
- Orig date:
Sun Oct 8 10:50:30 2000
diff -u --recursive --new-file v2.4.0-test9/linux/drivers/usb/devio.c linux/drivers/usb/devio.c
@@ -1035,12 +1035,14 @@
if ((size = _IOC_SIZE (ctrl.ioctl_code)) > 0) {
if ((buf = kmalloc (size, GFP_KERNEL)) == 0)
return -ENOMEM;
- if ((_IOC_DIR (ctrl.ioctl_code) & _IOC_WRITE) != 0
- && copy_from_user (buf, ctrl.data, size) != 0) {
- kfree (buf);
- return -EFAULT;
- } else
+ if ((_IOC_DIR(ctrl.ioctl_code) & _IOC_WRITE)) {
+ if (copy_from_user (buf, ctrl.data, size)) {
+ kfree (buf);
+ return -EFAULT;
+ }
+ } else {
memset (buf, 0, size);
+ }
}
/* ioctl to device */
FUNET's LINUX-ADM group, linux-adm@nic.funet.fi
TCL-scripts by Sam Shen (who was at: slshen@lbl.gov)