aboutsummaryrefslogtreecommitdiff
path: root/drivers
diff options
context:
space:
mode:
authorDavid Kershner <david.kershner@unisys.com>2017-03-28 09:34:27 -0400
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2017-03-29 09:17:02 +0200
commitc53578bd6c3d57d6599e66a39d6d53a1c6165285 (patch)
tree05258beba8e6a1f6a2b0345b76beaf71801bc680 /drivers
parent0d40643672ddb5833b8404397010c3d44515cad0 (diff)
staging: unisys: visorbus: add error handling to remaining_steps_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>
Diffstat (limited to 'drivers')
-rw-r--r--drivers/staging/unisys/visorbus/visorchipset.c12
1 files changed, 8 insertions, 4 deletions
diff --git a/drivers/staging/unisys/visorbus/visorchipset.c b/drivers/staging/unisys/visorbus/visorchipset.c
index cd2f4194ab93..b2b201b3b16a 100644
--- a/drivers/staging/unisys/visorbus/visorchipset.c
+++ b/drivers/staging/unisys/visorbus/visorchipset.c
@@ -242,11 +242,15 @@ static ssize_t remaining_steps_show(struct device *dev,
struct device_attribute *attr, char *buf)
{
u16 remaining_steps = 0;
+ int err;
+
+ err = visorchannel_read(chipset_dev->controlvm_channel,
+ offsetof(struct spar_controlvm_channel_protocol,
+ installation_remaining_steps),
+ &remaining_steps, sizeof(u16));
+ if (err)
+ return err;
- visorchannel_read(chipset_dev->controlvm_channel,
- offsetof(struct spar_controlvm_channel_protocol,
- installation_remaining_steps),
- &remaining_steps, sizeof(u16));
return sprintf(buf, "%hu\n", remaining_steps);
}