Commit cc55b5c5 authored by Jes Sorensen's avatar Jes Sorensen Committed by Greg Kroah-Hartman

staging: unisys: parser_init_guts(): standard_payload_header is always false

Signed-off-by: default avatarJes Sorensen <Jes.Sorensen@redhat.com>
Signed-off-by: default avatarBenjamin Romer <benjamin.romer@unisys.com>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent 464129ed
...@@ -376,18 +376,17 @@ static void controlvm_respond_physdev_changestate( ...@@ -376,18 +376,17 @@ static void controlvm_respond_physdev_changestate(
static void parser_done(struct parser_context *ctx); static void parser_done(struct parser_context *ctx);
static struct parser_context * static struct parser_context *
parser_init_guts(u64 addr, u32 bytes, bool local, parser_init_guts(u64 addr, u32 bytes, bool local, bool *retry)
bool standard_payload_header, bool *retry)
{ {
int allocbytes = sizeof(struct parser_context) + bytes; int allocbytes = sizeof(struct parser_context) + bytes;
struct parser_context *rc = NULL; struct parser_context *rc = NULL;
struct parser_context *ctx = NULL; struct parser_context *ctx = NULL;
struct spar_controlvm_parameters_header *phdr = NULL;
if (retry) if (retry)
*retry = false; *retry = false;
if (!standard_payload_header)
/* alloc and 0 extra byte to ensure payload is /*
* alloc an 0 extra byte to ensure payload is
* '\0'-terminated * '\0'-terminated
*/ */
allocbytes++; allocbytes++;
...@@ -437,26 +436,8 @@ parser_init_guts(u64 addr, u32 bytes, bool local, ...@@ -437,26 +436,8 @@ parser_init_guts(u64 addr, u32 bytes, bool local,
memcpy_fromio(ctx->data, mapping, bytes); memcpy_fromio(ctx->data, mapping, bytes);
release_mem_region(addr, bytes); release_mem_region(addr, bytes);
} }
if (!standard_payload_header) {
ctx->byte_stream = true;
rc = ctx;
goto cleanup;
}
phdr = (struct spar_controlvm_parameters_header *)(ctx->data);
if (phdr->total_length != bytes) {
rc = NULL;
goto cleanup;
}
if (phdr->total_length < phdr->header_length) {
rc = NULL;
goto cleanup;
}
if (phdr->header_length <
sizeof(struct spar_controlvm_parameters_header)) {
rc = NULL;
goto cleanup;
}
ctx->byte_stream = true;
rc = ctx; rc = ctx;
cleanup: cleanup:
if (rc) { if (rc) {
...@@ -478,7 +459,7 @@ parser_init_guts(u64 addr, u32 bytes, bool local, ...@@ -478,7 +459,7 @@ parser_init_guts(u64 addr, u32 bytes, bool local,
static struct parser_context * static struct parser_context *
parser_init_byte_stream(u64 addr, u32 bytes, bool local, bool *retry) parser_init_byte_stream(u64 addr, u32 bytes, bool local, bool *retry)
{ {
return parser_init_guts(addr, bytes, local, false, retry); return parser_init_guts(addr, bytes, local, retry);
} }
static uuid_le static uuid_le
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment