patch-2.4.13 linux/fs/udf/file.c
Next file: linux/fs/udf/ialloc.c
Previous file: linux/fs/udf/dir.c
Back to the patch index
Back to the overall index
- Lines: 51
- Date:
Thu Oct 11 08:59:24 2001
- Orig file:
v2.4.12/linux/fs/udf/file.c
- Orig date:
Tue Jul 3 17:08:21 2001
diff -u --recursive --new-file v2.4.12/linux/fs/udf/file.c linux/fs/udf/file.c
@@ -206,7 +206,7 @@
int udf_ioctl(struct inode *inode, struct file *filp, unsigned int cmd,
unsigned long arg)
{
- int result = -1;
+ int result = -EINVAL;
struct buffer_head *bh = NULL;
long_ad eaicb;
Uint8 *ea = NULL;
@@ -228,16 +228,16 @@
switch (cmd)
{
case UDF_GETVOLIDENT:
- if ( (result == verify_area(VERIFY_WRITE, (char *)arg, 32)) == 0)
- result = copy_to_user((char *)arg, UDF_SB_VOLIDENT(inode->i_sb), 32);
- return result;
+ return copy_to_user((char *)arg,
+ UDF_SB_VOLIDENT(inode->i_sb), 32) ? -EFAULT : 0;
case UDF_RELOCATE_BLOCKS:
{
long old, new;
if (!capable(CAP_SYS_ADMIN)) return -EACCES;
- get_user(old, (long *)arg);
- if ((result = udf_relocate_blocks(inode->i_sb, old, &new)) == 0)
+ if (get_user(old, (long *)arg)) return -EFAULT;
+ if ((result = udf_relocate_blocks(inode->i_sb,
+ old, &new)) == 0)
result = put_user(new, (long *)arg);
return result;
@@ -277,16 +277,12 @@
switch (cmd)
{
case UDF_GETEASIZE:
- if ( (result = verify_area(VERIFY_WRITE, (char *)arg, 4)) == 0)
- result = put_user(UDF_I_LENEATTR(inode), (int *)arg);
+ result = put_user(UDF_I_LENEATTR(inode), (int *)arg);
break;
case UDF_GETEABLOCK:
- if ( (result = verify_area(VERIFY_WRITE, (char *)arg, UDF_I_LENEATTR(inode))) == 0)
- result = copy_to_user((char *)arg, ea, UDF_I_LENEATTR(inode));
- break;
-
- default:
+ result = copy_to_user((char *)arg, ea,
+ UDF_I_LENEATTR(inode)) ? -EFAULT : 0;
break;
}
FUNET's LINUX-ADM group, linux-adm@nic.funet.fi
TCL-scripts by Sam Shen (who was at: slshen@lbl.gov)