Signed-off-by: Jes Sorensen <Jes.Sorensen@redhat.com>
Signed-off-by: Benjamin Romer <benjamin.romer@unisys.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
struct parser_context *ctx = NULL;
struct memregion *rgn = NULL;
struct spar_controlvm_parameters_header *phdr = NULL;
+ int cnt;
if (retry)
*retry = false;
rc = NULL;
goto cleanup;
}
- if (visor_memregion_read(rgn, 0, ctx->data, bytes) < 0) {
+ cnt = visor_memregion_read(rgn, 0, ctx->data, bytes);
+ visor_memregion_destroy(rgn);
+
+ if (cnt < 0) {
rc = NULL;
goto cleanup;
}
rc = ctx;
cleanup:
- if (rgn) {
- visor_memregion_destroy(rgn);
- rgn = NULL;
- }
if (rc) {
controlvm_payload_bytes_buffered += ctx->param_bytes;
} else {