loader: zfs_alloc and zfs_free should use panic

The zfs alloc and free code print out the error and get stuck in infinite loop; use panic() instead.
This commit is contained in:
Toomas Soome 2019-05-29 07:24:10 +00:00
parent bec2d7e9a2
commit 51e5c6b89e

View File

@ -107,8 +107,7 @@ zfs_alloc(size_t size)
char *ptr;
if (zfs_temp_ptr + size > zfs_temp_end) {
printf("ZFS: out of temporary buffer space\n");
for (;;) ;
panic("ZFS: out of temporary buffer space");
}
ptr = zfs_temp_ptr;
zfs_temp_ptr += size;
@ -122,8 +121,7 @@ zfs_free(void *ptr, size_t size)
zfs_temp_ptr -= size;
if (zfs_temp_ptr != ptr) {
printf("ZFS: zfs_alloc()/zfs_free() mismatch\n");
for (;;) ;
panic("ZFS: zfs_alloc()/zfs_free() mismatch");
}
}