From c53578bd6c3d57d6599e66a39d6d53a1c6165285 Mon Sep 17 00:00:00 2001 From: David Kershner Date: Tue, 28 Mar 2017 09:34:27 -0400 Subject: [PATCH] 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 Reviewed-by: Reviewed-by: Tim Sell Signed-off-by: Greg Kroah-Hartman --- drivers/staging/unisys/visorbus/visorchipset.c | 12 ++++++++---- 1 file 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); } -- 2.20.1