summaryrefslogtreecommitdiffstats
path: root/drivers/staging/unisys/visorbus/visorchipset.c
diff options
context:
space:
mode:
authorDavid Kershner2017-03-28 15:34:54 +0200
committerGreg Kroah-Hartman2017-03-29 09:17:03 +0200
commitb4a8e6ae1744b775fd3656e6b83cbbdaa06fb73c (patch)
treecc6fb429583035f2852e54ee42736dcf7a66570e /drivers/staging/unisys/visorbus/visorchipset.c
parentstaging: unisys: visorbus: add error handling to initiate_chipset_device_paus... (diff)
downloadkernel-qcow2-linux-b4a8e6ae1744b775fd3656e6b83cbbdaa06fb73c.tar.gz
kernel-qcow2-linux-b4a8e6ae1744b775fd3656e6b83cbbdaa06fb73c.tar.xz
kernel-qcow2-linux-b4a8e6ae1744b775fd3656e6b83cbbdaa06fb73c.zip
staging: unisys: visorbus: add error handling to chipset_device_pause/resume
If there is an error in chipset_device_pause/resume don't try to respond, error out and let the calling functions respond to this error just like any other error they encounter. Signed-off-by: David Kershner <david.kershner@unisys.com> Reviewed-by: 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.c9
1 files changed, 6 insertions, 3 deletions
diff --git a/drivers/staging/unisys/visorbus/visorchipset.c b/drivers/staging/unisys/visorbus/visorchipset.c
index be1171e00ea3..260307b83a2f 100644
--- a/drivers/staging/unisys/visorbus/visorchipset.c
+++ b/drivers/staging/unisys/visorbus/visorchipset.c
@@ -883,7 +883,7 @@ my_device_changestate(struct controlvm_message *inmsg)
u32 dev_no = cmd->device_change_state.dev_no;
struct spar_segment_state state = cmd->device_change_state.state;
struct visor_device *dev_info;
- int err;
+ int err = 0;
dev_info = visorbus_get_device_by_id(bus_no, dev_no, NULL);
if (!dev_info) {
@@ -918,7 +918,7 @@ my_device_changestate(struct controlvm_message *inmsg)
if (state.alive == segment_state_running.alive &&
state.operating == segment_state_running.operating)
/* Response will be sent from chipset_device_resume */
- chipset_device_resume(dev_info);
+ err = chipset_device_resume(dev_info);
/* ServerNotReady / ServerLost / SegmentStateStandby */
else if (state.alive == segment_state_standby.alive &&
state.operating == segment_state_standby.operating)
@@ -926,7 +926,10 @@ my_device_changestate(struct controlvm_message *inmsg)
* technically this is standby case where server is lost.
* Response will be sent from chipset_device_pause.
*/
- chipset_device_pause(dev_info);
+ err = chipset_device_pause(dev_info);
+ if (err)
+ goto err_respond;
+
return 0;
err_respond: