patch-2.4.0-test8 linux/drivers/sbus/char/openprom.c
Next file: linux/drivers/sbus/char/rtc.c
Previous file: linux/drivers/sbus/char/display7seg.c
Back to the patch index
Back to the overall index
- Lines: 92
- Date:
Tue Aug 29 14:09:15 2000
- Orig file:
v2.4.0-test7/linux/drivers/sbus/char/openprom.c
- Orig date:
Thu Jul 27 17:38:01 2000
diff -u --recursive --new-file v2.4.0-test7/linux/drivers/sbus/char/openprom.c linux/drivers/sbus/char/openprom.c
@@ -73,7 +73,8 @@
if (!info || !opp_p)
return -EFAULT;
- get_user_ret(bufsize, &info->oprom_size, -EFAULT);
+ if (get_user(bufsize, &info->oprom_size))
+ return -EFAULT;
if (bufsize == 0)
return -EINVAL;
@@ -132,7 +133,8 @@
*/
static int copyout(void *info, struct openpromio *opp, int len)
{
- copy_to_user_ret(info, opp, len, -EFAULT);
+ if (copy_to_user(info, opp, len))
+ return -EFAULT;
return 0;
}
@@ -364,7 +366,8 @@
switch (cmd) {
case OPIOCGET:
- copy_from_user_ret(&op, (void *)arg, sizeof(op), -EFAULT);
+ if (copy_from_user(&op, (void *)arg, sizeof(op)))
+ return -EFAULT;
if (!goodnode(op.op_nodeid,data))
return -EINVAL;
@@ -386,9 +389,10 @@
if (len <= 0) {
kfree(str);
- /* Verified by the above copy_from_user_ret */
- __copy_to_user_ret((void *)arg, &op,
- sizeof(op), -EFAULT);
+ /* Verified by the above copy_from_user */
+ if (__copy_to_user((void *)arg, &op,
+ sizeof(op)))
+ return -EFAULT;
return 0;
}
@@ -414,7 +418,8 @@
return error;
case OPIOCNEXTPROP:
- copy_from_user_ret(&op, (void *)arg, sizeof(op), -EFAULT);
+ if (copy_from_user(&op, (void *)arg, sizeof(op)))
+ return -EFAULT;
if (!goodnode(op.op_nodeid,data))
return -EINVAL;
@@ -457,7 +462,8 @@
return error;
case OPIOCSET:
- copy_from_user_ret(&op, (void *)arg, sizeof(op), -EFAULT);
+ if (copy_from_user(&op, (void *)arg, sizeof(op)))
+ return -EFAULT;
if (!goodnode(op.op_nodeid,data))
return -EINVAL;
@@ -485,13 +491,14 @@
return 0;
case OPIOCGETOPTNODE:
- copy_to_user_ret((void *)arg, &options_node,
- sizeof(int), -EFAULT);
+ if (copy_to_user((void *)arg, &options_node, sizeof(int)))
+ return -EFAULT;
return 0;
case OPIOCGETNEXT:
case OPIOCGETCHILD:
- copy_from_user_ret(&node, (void *)arg, sizeof(int), -EFAULT);
+ if (copy_from_user(&node, (void *)arg, sizeof(int)))
+ return -EFAULT;
save_and_cli(flags);
if (cmd == OPIOCGETNEXT)
@@ -500,7 +507,8 @@
node = __prom_getchild(node);
restore_flags(flags);
- __copy_to_user_ret((void *)arg, &node, sizeof(int), -EFAULT);
+ if (__copy_to_user((void *)arg, &node, sizeof(int)))
+ return -EFAULT;
return 0;
FUNET's LINUX-ADM group, linux-adm@nic.funet.fi
TCL-scripts by Sam Shen (who was at: slshen@lbl.gov)