]> Pileus Git - ~andy/linux/blobdiff - fs/squashfs/namei.c
Merge tag 'at91-for-next-dt' of git://github.com/at91linux/linux-at91 into next/dt
[~andy/linux] / fs / squashfs / namei.c
index 0682b38d7e316beecc2c8ffe0a5c29b5e4997288..abcc58f3c15266dd24b9533b4b1103d3514a0c3e 100644 (file)
@@ -144,7 +144,7 @@ static struct dentry *squashfs_lookup(struct inode *dir, struct dentry *dentry,
        struct squashfs_dir_entry *dire;
        u64 block = squashfs_i(dir)->start + msblk->directory_table;
        int offset = squashfs_i(dir)->offset;
-       int err, length = 0, dir_count, size;
+       int err, length, dir_count, size;
 
        TRACE("Entered squashfs_lookup [%llx:%x]\n", block, offset);
 
@@ -177,8 +177,7 @@ static struct dentry *squashfs_lookup(struct inode *dir, struct dentry *dentry,
 
                dir_count = le32_to_cpu(dirh.count) + 1;
 
-               /* dir_count should never be larger than 256 */
-               if (dir_count > 256)
+               if (dir_count > SQUASHFS_DIR_COUNT)
                        goto data_error;
 
                while (dir_count--) {