diff options
Diffstat (limited to 'fs')
-rw-r--r-- | fs/cramfs/inode.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/fs/cramfs/inode.c b/fs/cramfs/inode.c index 7f76abbe945f..350680fd7da7 100644 --- a/fs/cramfs/inode.c +++ b/fs/cramfs/inode.c | |||
@@ -361,7 +361,7 @@ static int cramfs_readdir(struct file *filp, void *dirent, filldir_t filldir) | |||
361 | if (offset & 3) | 361 | if (offset & 3) |
362 | return -EINVAL; | 362 | return -EINVAL; |
363 | 363 | ||
364 | buf = kmalloc(256, GFP_KERNEL); | 364 | buf = kmalloc(CRAMFS_MAXPATHLEN, GFP_KERNEL); |
365 | if (!buf) | 365 | if (!buf) |
366 | return -ENOMEM; | 366 | return -ENOMEM; |
367 | 367 | ||
@@ -375,7 +375,7 @@ static int cramfs_readdir(struct file *filp, void *dirent, filldir_t filldir) | |||
375 | int namelen, error; | 375 | int namelen, error; |
376 | 376 | ||
377 | mutex_lock(&read_mutex); | 377 | mutex_lock(&read_mutex); |
378 | de = cramfs_read(sb, OFFSET(inode) + offset, sizeof(*de)+256); | 378 | de = cramfs_read(sb, OFFSET(inode) + offset, sizeof(*de)+CRAMFS_MAXPATHLEN); |
379 | name = (char *)(de+1); | 379 | name = (char *)(de+1); |
380 | 380 | ||
381 | /* | 381 | /* |
@@ -425,7 +425,7 @@ static struct dentry * cramfs_lookup(struct inode *dir, struct dentry *dentry, s | |||
425 | char *name; | 425 | char *name; |
426 | int namelen, retval; | 426 | int namelen, retval; |
427 | 427 | ||
428 | de = cramfs_read(dir->i_sb, OFFSET(dir) + offset, sizeof(*de)+256); | 428 | de = cramfs_read(dir->i_sb, OFFSET(dir) + offset, sizeof(*de)+CRAMFS_MAXPATHLEN); |
429 | name = (char *)(de+1); | 429 | name = (char *)(de+1); |
430 | 430 | ||
431 | /* Try to take advantage of sorted directories */ | 431 | /* Try to take advantage of sorted directories */ |