From: Andrei Borzenkov Subject: [PATCH] zfs: add NULL check and simplify code --- grub-core/fs/zfs/zfs.c | 13 ++++--------- 1 file changed, 4 insertions(+), 9 deletions(-) diff --git a/grub-core/fs/zfs/zfs.c b/grub-core/fs/zfs/zfs.c index 0cbb84b..29e356d 100644 --- a/grub-core/fs/zfs/zfs.c +++ b/grub-core/fs/zfs/zfs.c @@ -1836,15 +1836,10 @@ zio_read (blkptr_t *bp, grub_zfs_endian_t endian, void **buf, return grub_error (GRUB_ERR_NOT_IMPLEMENTED_YET, "compression algorithm %s not supported\n", decomp_table[comp].name); - if (comp != ZIO_COMPRESS_OFF) - { - /* It's not really necessary to align to 16, just for safety. */ - compbuf = grub_malloc (ALIGN_UP (psize, 16)); - if (! compbuf) - return grub_errno; - } - else - compbuf = *buf = grub_malloc (lsize); + /* It's not really necessary to align to 16, just for safety. */ + compbuf = grub_malloc (ALIGN_UP (psize, 16)); + if (! compbuf) + return grub_errno; grub_dprintf ("zfs", "endian = %d\n", endian); err = zio_read_data (bp, endian, compbuf, data); -- tg: (677dcaa..) u/zfs/zio_read_psize (depends on: master)