summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDavid Kershner <david.kershner@unisys.com>2017-03-28 16:34:25 +0300
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2017-03-29 10:17:02 +0300
commitd9857c794ee858cc6447fcd182da81b5099e5c4d (patch)
treedf41446a1c2348c6adeb68d60a76e44aebcfff99
parent0b01c6ce5a69b7fffd08281422f4aff6df7f55ff (diff)
downloadlinux-d9857c794ee858cc6447fcd182da81b5099e5c4d.tar.xz
staging: unisys: visorbus: add error handling to error_show
Don't just drop the error from visorchannel_read on the floor, report it. 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>
-rw-r--r--drivers/staging/unisys/visorbus/visorchipset.c11
1 files changed, 7 insertions, 4 deletions
diff --git a/drivers/staging/unisys/visorbus/visorchipset.c b/drivers/staging/unisys/visorbus/visorchipset.c
index 00fd02f5a71f..b09ef4ce5ae2 100644
--- a/drivers/staging/unisys/visorbus/visorchipset.c
+++ b/drivers/staging/unisys/visorbus/visorchipset.c
@@ -170,11 +170,14 @@ static ssize_t error_show(struct device *dev, struct device_attribute *attr,
char *buf)
{
u32 error = 0;
+ int err;
- visorchannel_read(chipset_dev->controlvm_channel,
- offsetof(struct spar_controlvm_channel_protocol,
- installation_error),
- &error, sizeof(u32));
+ err = visorchannel_read(chipset_dev->controlvm_channel,
+ offsetof(struct spar_controlvm_channel_protocol,
+ installation_error),
+ &error, sizeof(u32));
+ if (err)
+ return err;
return sprintf(buf, "%i\n", error);
}