diff --git a/usr.sbin/bhyve/qemu_fwcfg.c b/usr.sbin/bhyve/qemu_fwcfg.c --- a/usr.sbin/bhyve/qemu_fwcfg.c +++ b/usr.sbin/bhyve/qemu_fwcfg.c @@ -594,14 +594,11 @@ return (ENOMEM); } fwcfg_file->size = read(fd, fwcfg_file->data, sb.st_size); - if ((ssize_t)fwcfg_file->size < 0) { + if (fwcfg_file->size != sb.st_size) { warn("Unable to read file \"%s\"", opt_ptr); free(fwcfg_file->data); close(fd); return (-1); - } else if (fwcfg_file->size < sb.st_size) { - warnx("Only read %u bytes of file \"%s\"", - fwcfg_file->size, opt_ptr); } close(fd);