summaryrefslogtreecommitdiffstats
path: root/drivers/staging/unisys/visorbus/visorchipset.c
diff options
context:
space:
mode:
authorDavid Kershner2016-11-03 16:44:25 +0100
committerGreg Kroah-Hartman2016-11-07 10:56:39 +0100
commit0825f191ec603b29f0586b5c6a8592145079007f (patch)
tree7eb0fd225fc8fa3a9ab4d66e0e38dd5f20162221 /drivers/staging/unisys/visorbus/visorchipset.c
parentstaging: unisys: visorbus: my_device_create does not call device_epilog (diff)
downloadkernel-qcow2-linux-0825f191ec603b29f0586b5c6a8592145079007f.tar.gz
kernel-qcow2-linux-0825f191ec603b29f0586b5c6a8592145079007f.tar.xz
kernel-qcow2-linux-0825f191ec603b29f0586b5c6a8592145079007f.zip
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: David Kershner <david.kershner@unisys.com> Reported-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org> Reviewed-by: Tim Sell <Timothy.Sell@unisys.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/staging/unisys/visorbus/visorchipset.c')
-rw-r--r--drivers/staging/unisys/visorbus/visorchipset.c17
1 files changed, 12 insertions, 5 deletions
diff --git a/drivers/staging/unisys/visorbus/visorchipset.c b/drivers/staging/unisys/visorbus/visorchipset.c
index d10712147601..f8dca04b1219 100644
--- a/drivers/staging/unisys/visorbus/visorchipset.c
+++ b/drivers/staging/unisys/visorbus/visorchipset.c
@@ -1046,15 +1046,22 @@ my_device_changestate(struct controlvm_message *inmsg)
POSTCODE_LINUX_4(DEVICE_CHANGESTATE_FAILURE_PC, dev_no, bus_no,
POSTCODE_SEVERITY_ERR);
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_SEVERITY_ERR);
rc = -CONTROLVM_RESP_ERROR_DEVICE_INVALID;
+ goto err_respond;
}
- if ((rc >= CONTROLVM_RESP_SUCCESS) && dev_info)
- device_epilog(dev_info, state,
- CONTROLVM_DEVICE_CHANGESTATE, &inmsg->hdr, rc,
- inmsg->hdr.flags.response_expected == 1, 1);
+
+ device_epilog(dev_info, state,
+ CONTROLVM_DEVICE_CHANGESTATE, &inmsg->hdr, rc,
+ inmsg->hdr.flags.response_expected == 1, 1);
+ return;
+
+err_respond:
+ device_responder(inmsg->hdr.id, &inmsg->hdr, rc);
}
static void