[PATCH 10/44] staging: unisys: visorbus: add error handling to remaining_steps_show

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Don't just drop the error from visorchannel_read on the floor, report it.

Signed-off-by: David Kershner <david.kershner@xxxxxxxxxx>
Reviewed-by: Reviewed-by: Tim Sell <timothy.sell@xxxxxxxxxx>
---
 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 cd2f419..b2b201b 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);
 }
 
-- 
git-series 0.9.1
_______________________________________________
devel mailing list
devel@xxxxxxxxxxxxxxxxxxxxxx
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel



[Index of Archives]     [Linux Driver Backports]     [DMA Engine]     [Linux GPIO]     [Linux SPI]     [Video for Linux]     [Linux USB Devel]     [Linux Coverity]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [Yosemite Backpacking]
  Powered by Linux