+2012-01-14 Vladimir Serbinenko <phcoder@gmail.com>
+
+ * grub-core/fs/zfs/zfs.c (grub_zfs_read): Remove useless alloc and
+ handle NULL appropriately.
+ Remove MIN.
+
2012-01-13 Vladimir Serbinenko <phcoder@gmail.com>
Fix efiemu.
grub_size_t read;
grub_err_t err;
- if (data->file_buf == NULL)
- {
- data->file_buf = grub_malloc (SPA_MAXBLOCKSIZE);
- if (!data->file_buf)
- return -1;
- data->file_start = data->file_end = 0;
- }
-
/*
* If offset is in memory, move it into the buffer provided and return.
*/
0, data);
data->file_buf = t;
if (err)
- return -1;
+ {
+ data->file_buf = NULL;
+ data->file_start = data->file_end = 0;
+ return -1;
+ }
data->file_start = blkid * blksz;
data->file_end = data->file_start + blksz;
- movesize = MIN (length, data->file_end - file->offset - read);
+ movesize = data->file_end - file->offset - read;
+ if (movesize > length)
+ movesize = length;
grub_memmove (buf, data->file_buf + file->offset + read
- data->file_start, movesize);