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

staging: unisys: visorbus: my_device_changestate: add error response

The function my_device_changestate was not sending a response if there
was an error with the CONTROLVM message.
Signed-off-by: default avatarDavid Kershner <david.kershner@unisys.com>
Reported-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Reviewed-by: default avatarTim Sell <Timothy.Sell@unisys.com>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent 5a80e98a
...@@ -1046,15 +1046,22 @@ my_device_changestate(struct controlvm_message *inmsg) ...@@ -1046,15 +1046,22 @@ my_device_changestate(struct controlvm_message *inmsg)
POSTCODE_LINUX_4(DEVICE_CHANGESTATE_FAILURE_PC, dev_no, bus_no, POSTCODE_LINUX_4(DEVICE_CHANGESTATE_FAILURE_PC, dev_no, bus_no,
POSTCODE_SEVERITY_ERR); POSTCODE_SEVERITY_ERR);
rc = -CONTROLVM_RESP_ERROR_DEVICE_INVALID; rc = -CONTROLVM_RESP_ERROR_DEVICE_INVALID;
} else if (dev_info->state.created == 0) { goto err_respond;
}
if (dev_info->state.created == 0) {
POSTCODE_LINUX_4(DEVICE_CHANGESTATE_FAILURE_PC, dev_no, bus_no, POSTCODE_LINUX_4(DEVICE_CHANGESTATE_FAILURE_PC, dev_no, bus_no,
POSTCODE_SEVERITY_ERR); POSTCODE_SEVERITY_ERR);
rc = -CONTROLVM_RESP_ERROR_DEVICE_INVALID; rc = -CONTROLVM_RESP_ERROR_DEVICE_INVALID;
goto err_respond;
} }
if ((rc >= CONTROLVM_RESP_SUCCESS) && dev_info)
device_epilog(dev_info, state, device_epilog(dev_info, state,
CONTROLVM_DEVICE_CHANGESTATE, &inmsg->hdr, rc, CONTROLVM_DEVICE_CHANGESTATE, &inmsg->hdr, rc,
inmsg->hdr.flags.response_expected == 1, 1); inmsg->hdr.flags.response_expected == 1, 1);
return;
err_respond:
device_responder(inmsg->hdr.id, &inmsg->hdr, 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