X-Git-Url: http://review.tizen.org/git/?a=blobdiff_plain;f=fs%2Fzfs%2Fzfs.c;h=4331c16064ca2b7c0416fb902d35f225f1f420d9;hb=83d290c56fab2d38cd1ab4c4cc7099559c1d5046;hp=818d3d926d2a3a349ac2e96bef28bc93e24b49cf;hpb=2c3dc792b6df16970077c0d64085e29f1f85d4c8;p=platform%2Fkernel%2Fu-boot.git diff --git a/fs/zfs/zfs.c b/fs/zfs/zfs.c index 818d3d9..4331c16 100644 --- a/fs/zfs/zfs.c +++ b/fs/zfs/zfs.c @@ -1,3 +1,4 @@ +// SPDX-License-Identifier: GPL-2.0+ /* * * ZFS filesystem ported to u-boot by @@ -7,8 +8,6 @@ * Copyright (C) 1999,2000,2001,2002,2003,2004 * Free Software Foundation, Inc. * Copyright 2004 Sun Microsystems, Inc. - * - * SPDX-License-Identifier: GPL-2.0+ */ #include @@ -20,7 +19,7 @@ #include "zfs_common.h" #include "div64.h" -block_dev_desc_t *zfs_dev_desc; +struct blk_desc *zfs_dev_desc; /* * The zfs plug-in routines for GRUB are: @@ -736,7 +735,7 @@ zap_hash(uint64_t salt, const char *name) uint64_t crc = salt; if (table[128] == 0) { - uint64_t *ct; + uint64_t *ct = NULL; int i, j; for (i = 0; i < 256; i++) { for (ct = table + i, *ct = i, j = 8; j > 0; j--) @@ -1060,6 +1059,7 @@ zap_lookup(dnode_end_t *zap_dnode, char *name, uint64_t *val, } printf("unknown ZAP type\n"); + free(zapbuf); return ZFS_ERR_BAD_FS; } @@ -1094,6 +1094,7 @@ zap_iterate(dnode_end_t *zap_dnode, return ret; } printf("unknown ZAP type\n"); + free(zapbuf); return 0; } @@ -1865,6 +1866,7 @@ zfs_mount(device_t dev) ubbest = malloc(sizeof(*ubbest)); if (!ubbest) { + free(ub_array); zfs_unmount(data); return 0; } @@ -1953,6 +1955,7 @@ zfs_mount(device_t dev) if (err) { printf("couldn't zio_read object directory\n"); zfs_unmount(data); + free(osp); free(ubbest); return 0; } @@ -2052,6 +2055,9 @@ zfs_open(struct zfs_file *file, const char *fsfilename) hdrsize = SA_HDR_SIZE(((sa_hdr_phys_t *) sahdrp)); file->size = *(uint64_t *) ((char *) sahdrp + hdrsize + SA_SIZE_OFFSET); + if ((data->dnode.dn.dn_bonuslen == 0) && + (data->dnode.dn.dn_flags & DNODE_FLAG_SPILL_BLKPTR)) + free(sahdrp); } else { file->size = zfs_to_cpu64(((znode_phys_t *) DN_BONUS(&data->dnode.dn))->zp_size, data->dnode.endian); }