staging: unisys: visorchipset: parser_init_guts(): Localize memregion usage
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>
This commit is contained in:
parent
75d1e6613c
commit
712c03dcab
1 changed files with 5 additions and 5 deletions
|
@ -399,6 +399,7 @@ parser_init_guts(u64 addr, u32 bytes, bool local,
|
||||||
struct parser_context *ctx = NULL;
|
struct parser_context *ctx = NULL;
|
||||||
struct memregion *rgn = NULL;
|
struct memregion *rgn = NULL;
|
||||||
struct spar_controlvm_parameters_header *phdr = NULL;
|
struct spar_controlvm_parameters_header *phdr = NULL;
|
||||||
|
int cnt;
|
||||||
|
|
||||||
if (retry)
|
if (retry)
|
||||||
*retry = false;
|
*retry = false;
|
||||||
|
@ -442,7 +443,10 @@ parser_init_guts(u64 addr, u32 bytes, bool local,
|
||||||
rc = NULL;
|
rc = NULL;
|
||||||
goto cleanup;
|
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;
|
rc = NULL;
|
||||||
goto cleanup;
|
goto cleanup;
|
||||||
}
|
}
|
||||||
|
@ -469,10 +473,6 @@ parser_init_guts(u64 addr, u32 bytes, bool local,
|
||||||
|
|
||||||
rc = ctx;
|
rc = ctx;
|
||||||
cleanup:
|
cleanup:
|
||||||
if (rgn) {
|
|
||||||
visor_memregion_destroy(rgn);
|
|
||||||
rgn = NULL;
|
|
||||||
}
|
|
||||||
if (rc) {
|
if (rc) {
|
||||||
controlvm_payload_bytes_buffered += ctx->param_bytes;
|
controlvm_payload_bytes_buffered += ctx->param_bytes;
|
||||||
} else {
|
} else {
|
||||||
|
|
Loading…
Add table
Reference in a new issue