udf: fix ioctl errors
[sfrench/cifs-2.6.git] / fs / udf / file.c
index dbcb3a4a0cb99ca261774767230bd2af77233640..87551b77933a20656b0316853aee165fb4a5b239 100644 (file)
@@ -184,7 +184,8 @@ long udf_ioctl(struct file *filp, unsigned int cmd, unsigned long arg)
                goto out;
        }
 
-       if (!arg) {
+       if (!arg && ((cmd == UDF_GETVOLIDENT) || (cmd == UDF_GETEASIZE) ||
+                    (cmd == UDF_RELOCATE_BLOCKS) || (cmd == UDF_GETEABLOCK))) {
                udf_debug("invalid argument to udf_ioctl\n");
                result = -EINVAL;
                goto out;
@@ -220,6 +221,8 @@ long udf_ioctl(struct file *filp, unsigned int cmd, unsigned long arg)
                                      UDF_I(inode)->i_ext.i_data,
                                      UDF_I(inode)->i_lenEAttr) ? -EFAULT : 0;
                goto out;
+       default:
+               return -ENOIOCTLCMD;
        }
 
 out: