Fedora kernel-2.6.17-1.2142_FC4 patched with stable patch-2.6.17.4-vs2.0.2-rc26.diff
[linux-2.6.git] / fs / openpromfs / inode.c
index 5910d6b..0f14276 100644 (file)
@@ -94,8 +94,6 @@ static ssize_t property_read(struct file *filp, char __user *buf,
        openprom_property *op;
        char buffer[64];
        
-       if (*ppos >= 0xffffff || count >= 0xffffff)
-               return -EINVAL;
        if (!filp->private_data) {
                node = nodes[(u16)((long)inode->u.generic_ip)].node;
                i = ((u32)(long)inode->u.generic_ip) >> 16;
@@ -168,6 +166,8 @@ static ssize_t property_read(struct file *filp, char __user *buf,
                op = (openprom_property *)filp->private_data;
        if (!count || !(op->len || (op->flag & OPP_ASCIIZ)))
                return 0;
+       if (*ppos >= 0xffffff || count >= 0xffffff)
+               return -EINVAL;
        if (op->flag & OPP_STRINGLIST) {
                for (k = 0, p = op->value; p < op->value + op->len; p++)
                        if (!*p)
@@ -581,17 +581,17 @@ int property_release (struct inode *inode, struct file *filp)
        return 0;
 }
 
-static struct file_operations openpromfs_prop_ops = {
+static const struct file_operations openpromfs_prop_ops = {
        .read           = property_read,
        .write          = property_write,
        .release        = property_release,
 };
 
-static struct file_operations openpromfs_nodenum_ops = {
+static const struct file_operations openpromfs_nodenum_ops = {
        .read           = nodenum_read,
 };
 
-static struct file_operations openprom_operations = {
+static const struct file_operations openprom_operations = {
        .read           = generic_read_dir,
        .readdir        = openpromfs_readdir,
 };
@@ -1039,6 +1039,7 @@ static int openprom_fill_super(struct super_block *s, void *data, int silent)
        s->s_blocksize_bits = 10;
        s->s_magic = OPENPROM_SUPER_MAGIC;
        s->s_op = &openprom_sops;
+       s->s_time_gran = 1;
        root_inode = iget(s, OPENPROM_ROOT_INO);
        if (!root_inode)
                goto out_no_root;
@@ -1087,8 +1088,7 @@ static void __exit exit_openprom_fs(void)
        unregister_filesystem(&openprom_fs_type);
        free_pages ((unsigned long)nodes, alloced);
        for (i = 0; i < aliases_nodes; i++)
-               if (alias_names [i])
-                       kfree (alias_names [i]);
+               kfree (alias_names [i]);
        nodes = NULL;
 }