* grub-core/fs/zfs/zfs.c (zfs_mount): Fix spurious warning.

This commit is contained in:
Vladimir 'phcoder' Serbinenko 2011-11-10 08:43:08 +01:00
parent 45bd824d2e
commit cb544caa2e
2 changed files with 8 additions and 3 deletions

View file

@ -1,3 +1,7 @@
2011-11-10 Vladimir Serbinenko <phcoder@gmail.com>
* grub-core/fs/zfs/zfs.c (zfs_mount): Fix spurious warning.
2011-11-10 Vladimir Serbinenko <phcoder@gmail.com>
Fix ZFS memory and resource leaks.

View file

@ -3227,7 +3227,7 @@ zfs_mount (grub_device_t dev)
{
struct grub_zfs_data *data = 0;
grub_err_t err;
objset_phys_t *osp = 0;
void *osp = 0;
grub_size_t ospsize;
grub_zfs_endian_t ub_endian = GRUB_ZFS_UNKNOWN_ENDIAN;
uberblock_t *ub;
@ -3265,7 +3265,7 @@ zfs_mount (grub_device_t dev)
? GRUB_ZFS_LITTLE_ENDIAN : GRUB_ZFS_BIG_ENDIAN);
err = zio_read (&ub->ub_rootbp, ub_endian,
(void **) &osp, &ospsize, data);
&osp, &ospsize, data);
if (err)
{
zfs_unmount (data);
@ -3281,7 +3281,8 @@ zfs_mount (grub_device_t dev)
}
/* Got the MOS. Save it at the memory addr MOS. */
grub_memmove (&(data->mos.dn), &osp->os_meta_dnode, DNODE_SIZE);
grub_memmove (&(data->mos.dn), &((objset_phys_t *) osp)->os_meta_dnode,
DNODE_SIZE);
data->mos.endian = (grub_zfs_to_cpu64 (ub->ub_rootbp.blk_prop,
ub_endian) >> 63) & 1;
grub_free (osp);