Commit dde29996 authored by David Kershner's avatar David Kershner Committed by Greg Kroah-Hartman

staging: unisys: visorbus: get rid of gotos in intialize_controlvm_payload_info

Get rid of the gotos in initialize_controlvm_payload_info. The check in
the error path if payload was valid was never called so get rid of that
as well.
Signed-off-by: default avatarDavid Kershner <david.kershner@unisys.com>
Signed-off-by: default avatarTimothy Sell <timothy.sell@unisys.com>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent b899963f
...@@ -1382,35 +1382,23 @@ initialize_controlvm_payload_info(u64 phys_addr, u64 offset, u32 bytes, ...@@ -1382,35 +1382,23 @@ initialize_controlvm_payload_info(u64 phys_addr, u64 offset, u32 bytes,
struct visor_controlvm_payload_info *info) struct visor_controlvm_payload_info *info)
{ {
u8 *payload = NULL; u8 *payload = NULL;
int rc = CONTROLVM_RESP_SUCCESS;
if (!info) { if (!info)
rc = -CONTROLVM_RESP_ERROR_PAYLOAD_INVALID; return -CONTROLVM_RESP_ERROR_PAYLOAD_INVALID;
goto cleanup;
}
memset(info, 0, sizeof(struct visor_controlvm_payload_info)); memset(info, 0, sizeof(struct visor_controlvm_payload_info));
if ((offset == 0) || (bytes == 0)) { if ((offset == 0) || (bytes == 0))
rc = -CONTROLVM_RESP_ERROR_PAYLOAD_INVALID; return -CONTROLVM_RESP_ERROR_PAYLOAD_INVALID;
goto cleanup;
}
payload = memremap(phys_addr + offset, bytes, MEMREMAP_WB); payload = memremap(phys_addr + offset, bytes, MEMREMAP_WB);
if (!payload) { if (!payload)
rc = -CONTROLVM_RESP_ERROR_IOREMAP_FAILED; return -CONTROLVM_RESP_ERROR_IOREMAP_FAILED;
goto cleanup;
}
info->offset = offset; info->offset = offset;
info->bytes = bytes; info->bytes = bytes;
info->ptr = payload; info->ptr = payload;
cleanup: return CONTROLVM_RESP_SUCCESS;
if (rc < 0) {
if (payload) {
memunmap(payload);
payload = NULL;
}
}
return rc;
} }
static void static void
......
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