lkml.org 
[lkml]   [2005]   [Apr]   [22]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
Date
From
Subject[PATCH 6/10] squashfs: conserve stack, remove casts
Jörn

--
All art is but imitation of nature.
-- Lucius Annaeus Seneca


Signed-off-by: Jörn Engel <joern@wohnheim.fh-wedel.de>
---

fs/squashfs/inode.c | 8 ++++++--
1 files changed, 6 insertions(+), 2 deletions(-)

--- linux-2.6.12-rc3cow/fs/squashfs/inode.c~squashfs_cu6 2005-04-22 07:21:11.523554656 +0200
+++ linux-2.6.12-rc3cow/fs/squashfs/inode.c 2005-04-22 09:17:45.607292312 +0200
@@ -1405,12 +1405,15 @@ static int get_dir_index_using_name(stru
squashfs_sb_info *msBlk = s->s_fs_info;
squashfs_super_block *sBlk = &msBlk->sBlk;
int i, length = 0;
- char buffer[sizeof(squashfs_dir_index) + SQUASHFS_NAME_LEN + 1];
- squashfs_dir_index *index = (squashfs_dir_index *) buffer;
+ squashfs_dir_index *index;
char str[SQUASHFS_NAME_LEN + 1];

TRACE("Entered get_dir_index_using_name, i_count %d\n", i_count);

+ index = kmalloc(sizeof(*index) + SQUASHFS_NAME_LEN + 1, GFP_KERNEL);
+ if (!index)
+ return -ENOMEM;
+
strncpy(str, name, size);
str[size] = '\0';

@@ -1442,6 +1445,7 @@ static int get_dir_index_using_name(stru
}

*next_offset = (length + *next_offset) % SQUASHFS_METADATA_SIZE;
+ kfree(index);
return length;
}

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
\
 
 \ /
  Last update: 2005-04-22 09:27    [W:0.078 / U:0.240 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site