diff options
author | Sascha Hauer <s.hauer@pengutronix.de> | 2007-07-05 18:01:43 +0200 |
---|---|---|
committer | Sascha Hauer <sha@octopus.labnet.pengutronix.de> | 2007-07-05 18:01:43 +0200 |
commit | 57013a9864523d6ddfbe4c63a992c7534a793fad (patch) | |
tree | 01850a3920ee110fe7b8ff117c14c24564b86b04 /fs/cramfs | |
parent | b4906bc00f71f35099abd18eb4b90c603eb59b97 (diff) | |
download | barebox-57013a9864523d6ddfbe4c63a992c7534a793fad.tar.gz barebox-57013a9864523d6ddfbe4c63a992c7534a793fad.tar.xz |
svn_rev_324
use xzalloc instead of malloc/memset
Diffstat (limited to 'fs/cramfs')
-rw-r--r-- | fs/cramfs/cramfs.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/fs/cramfs/cramfs.c b/fs/cramfs/cramfs.c index 022dff4f20..69d333373c 100644 --- a/fs/cramfs/cramfs.c +++ b/fs/cramfs/cramfs.c @@ -31,6 +31,7 @@ #include <errno.h> #include <asm-generic/errno.h> #include <fs.h> +#include <xfuncs.h> #include <asm/byteorder.h> #include <linux/stat.h> @@ -209,8 +210,7 @@ struct dir* cramfs_opendir(struct device_d *_dev, const char *filename) struct fs_device_d *fsdev = _dev->type_data; struct device_d *dev = fsdev->parent; - struct cramfs_dir *dir = malloc(sizeof(struct cramfs_dir)); - memset(dir, 0, sizeof(struct cramfs_dir)); + struct cramfs_dir *dir = xzalloc(sizeof(struct cramfs_dir)); dir->dir.priv = dir; if (strlen (filename) == 0 || !strcmp (filename, "/")) { @@ -235,7 +235,6 @@ struct dir* cramfs_opendir(struct device_d *_dev, const char *filename) goto err_free; } - /* It's a directory. List files within */ dir->offset = CRAMFS_GET_OFFSET (dir->inode) << 2; dir->size = CRAMFS_24 (dir->inode->size); } @@ -466,3 +465,4 @@ int cramfs_init(void) } device_initcall(cramfs_init); + |