summaryrefslogtreecommitdiffstats
path: root/drivers/staging/unisys/visorbus/visorchipset.c
diff options
context:
space:
mode:
authorDavid Kershner2017-03-28 15:34:21 +0200
committerGreg Kroah-Hartman2017-03-29 09:17:02 +0200
commitae0fa822d7d455ba8974fb5fa1d437bfd1811a7a (patch)
tree4638f3b5561e84a4384956f62aee66a4abfa0dc7 /drivers/staging/unisys/visorbus/visorchipset.c
parentstaging: unisys: visorbus: add error handling to controlvm_periodic_work (diff)
downloadkernel-qcow2-linux-ae0fa822d7d455ba8974fb5fa1d437bfd1811a7a.tar.gz
kernel-qcow2-linux-ae0fa822d7d455ba8974fb5fa1d437bfd1811a7a.tar.xz
kernel-qcow2-linux-ae0fa822d7d455ba8974fb5fa1d437bfd1811a7a.zip
staging: unisys: visorbus: add error handling for parahotplug_request_kickoff
The function kobject_uevent_env returns an error we shouldn't just drop it on the floor but we should report it back to the caller. Since it now returns an error, need to add proper error handling to parahotplug_process_message. 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.c44
1 files changed, 28 insertions, 16 deletions
diff --git a/drivers/staging/unisys/visorbus/visorchipset.c b/drivers/staging/unisys/visorbus/visorchipset.c
index 8185430ecd37..47b167f321ae 100644
--- a/drivers/staging/unisys/visorbus/visorchipset.c
+++ b/drivers/staging/unisys/visorbus/visorchipset.c
@@ -1181,7 +1181,7 @@ static const struct attribute_group *visorchipset_dev_groups[] = {
* Cause uevent to run the user level script to do the disable/enable specified
* in the parahotplug_request.
*/
-static void
+static int
parahotplug_request_kickoff(struct parahotplug_request *req)
{
struct controlvm_message_packet *cmd = &req->msg.cmd;
@@ -1202,8 +1202,8 @@ parahotplug_request_kickoff(struct parahotplug_request *req)
sprintf(env_func, "SPAR_PARAHOTPLUG_FUNCTION=%d",
cmd->device_change_state.dev_no & 0x7);
- kobject_uevent_env(&chipset_dev->acpi_device->dev.kobj, KOBJ_CHANGE,
- envp);
+ return kobject_uevent_env(&chipset_dev->acpi_device->dev.kobj,
+ KOBJ_CHANGE, envp);
}
/*
@@ -1215,6 +1215,7 @@ static int
parahotplug_process_message(struct controlvm_message *inmsg)
{
struct parahotplug_request *req;
+ int err;
req = parahotplug_request_create(inmsg);
@@ -1233,26 +1234,37 @@ parahotplug_process_message(struct controlvm_message *inmsg)
* devices are automatically enabled at
* initialization.
*/
- parahotplug_request_kickoff(req);
+ err = parahotplug_request_kickoff(req);
+ if (err)
+ goto err_respond;
controlvm_respond_physdev_changestate
(&inmsg->hdr,
CONTROLVM_RESP_SUCCESS,
inmsg->cmd.device_change_state.state);
parahotplug_request_destroy(req);
- } else {
- /*
- * For disable messages, add the request to the
- * request list before kicking off the udev script. It
- * won't get responded to until the script has
- * indicated it's done.
- */
- spin_lock(&parahotplug_request_list_lock);
- list_add_tail(&req->list, &parahotplug_request_list);
- spin_unlock(&parahotplug_request_list_lock);
-
- parahotplug_request_kickoff(req);
+ return 0;
}
+
+ /*
+ * For disable messages, add the request to the
+ * request list before kicking off the udev script. It
+ * won't get responded to until the script has
+ * indicated it's done.
+ */
+ spin_lock(&parahotplug_request_list_lock);
+ list_add_tail(&req->list, &parahotplug_request_list);
+ spin_unlock(&parahotplug_request_list_lock);
+
+ err = parahotplug_request_kickoff(req);
+ if (err)
+ goto err_respond;
return 0;
+
+err_respond:
+ controlvm_respond_physdev_changestate
+ (&inmsg->hdr, err,
+ inmsg->cmd.device_change_state.state);
+ return err;
}
/*