From 7aaa1a92f621eec59a4ef834afefd831915a3521 Mon Sep 17 00:00:00 2001 From: David Sterba Date: Wed, 31 Aug 2016 19:38:31 +0200 Subject: btrfs-progs: mkfs: use preallocated buffers for config uuids No need for dynamic allocation, the buffers are small, remove the now-useless error conditions. Signed-off-by: David Sterba --- btrfs-convert.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) (limited to 'btrfs-convert.c') diff --git a/btrfs-convert.c b/btrfs-convert.c index c10dc172..5175f1f7 100644 --- a/btrfs-convert.c +++ b/btrfs-convert.c @@ -2373,10 +2373,8 @@ static int do_convert(const char *devname, int datacsum, int packing, mkfs_cfg.stripesize = blocksize; mkfs_cfg.features = features; /* New convert need these space */ - mkfs_cfg.fs_uuid = malloc(BTRFS_UUID_UNPARSED_SIZE); - mkfs_cfg.chunk_uuid = malloc(BTRFS_UUID_UNPARSED_SIZE); - *(mkfs_cfg.fs_uuid) = '\0'; - *(mkfs_cfg.chunk_uuid) = '\0'; + memset(mkfs_cfg.chunk_uuid, 0, BTRFS_UUID_UNPARSED_SIZE); + memset(mkfs_cfg.fs_uuid, 0, BTRFS_UUID_UNPARSED_SIZE); ret = make_btrfs(fd, &mkfs_cfg, &cctx); if (ret) { -- cgit v1.2.3