summaryrefslogtreecommitdiffstats
path: root/drivers/staging/unisys/visorbus/visorchipset.c
diff options
context:
space:
mode:
authorDavid Kershner2017-03-28 15:34:22 +0200
committerGreg Kroah-Hartman2017-03-29 09:17:02 +0200
commitdeeeca6db20fde52eafbc5985cfe4f4c10a7de8e (patch)
tree6d1d41c6c474e5ef426f8bca69ffdfd588e2e0c1 /drivers/staging/unisys/visorbus/visorchipset.c
parentstaging: unisys: visorbus: add error handling for parahotplug_request_kickoff (diff)
downloadkernel-qcow2-linux-deeeca6db20fde52eafbc5985cfe4f4c10a7de8e.tar.gz
kernel-qcow2-linux-deeeca6db20fde52eafbc5985cfe4f4c10a7de8e.tar.xz
kernel-qcow2-linux-deeeca6db20fde52eafbc5985cfe4f4c10a7de8e.zip
staging: unisys: visorbus: add error handling around kobject_uevent
The function kobject_uevent_env can return an error, pass that error to the caller so it can be handled correctly. 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.c26
1 files changed, 16 insertions, 10 deletions
diff --git a/drivers/staging/unisys/visorbus/visorchipset.c b/drivers/staging/unisys/visorbus/visorchipset.c
index 47b167f321ae..cb8c6f946c96 100644
--- a/drivers/staging/unisys/visorbus/visorchipset.c
+++ b/drivers/staging/unisys/visorbus/visorchipset.c
@@ -1277,12 +1277,15 @@ err_respond:
static int
chipset_ready_uevent(struct controlvm_message_header *msg_hdr)
{
- kobject_uevent(&chipset_dev->acpi_device->dev.kobj, KOBJ_ONLINE);
+ int res;
+
+ res = kobject_uevent(&chipset_dev->acpi_device->dev.kobj,
+ KOBJ_ONLINE);
if (msg_hdr->flags.response_expected)
- return controlvm_respond(msg_hdr, CONTROLVM_RESP_SUCCESS);
+ controlvm_respond(msg_hdr, res);
- return 0;
+ return res;
}
/*
@@ -1297,15 +1300,16 @@ chipset_selftest_uevent(struct controlvm_message_header *msg_hdr)
{
char env_selftest[20];
char *envp[] = { env_selftest, NULL };
+ int res;
sprintf(env_selftest, "SPARSP_SELFTEST=%d", 1);
- kobject_uevent_env(&chipset_dev->acpi_device->dev.kobj, KOBJ_CHANGE,
- envp);
+ res = kobject_uevent_env(&chipset_dev->acpi_device->dev.kobj,
+ KOBJ_CHANGE, envp);
if (msg_hdr->flags.response_expected)
- return controlvm_respond(msg_hdr, CONTROLVM_RESP_SUCCESS);
+ controlvm_respond(msg_hdr, res);
- return 0;
+ return res;
}
/*
@@ -1318,12 +1322,14 @@ chipset_selftest_uevent(struct controlvm_message_header *msg_hdr)
static int
chipset_notready_uevent(struct controlvm_message_header *msg_hdr)
{
- kobject_uevent(&chipset_dev->acpi_device->dev.kobj, KOBJ_OFFLINE);
+ int res;
+ res = kobject_uevent(&chipset_dev->acpi_device->dev.kobj,
+ KOBJ_OFFLINE);
if (msg_hdr->flags.response_expected)
- return controlvm_respond(msg_hdr, CONTROLVM_RESP_SUCCESS);
+ controlvm_respond(msg_hdr, res);
- return 0;
+ return res;
}
static unsigned int