From: David Kershner Date: Tue, 28 Mar 2017 13:34:25 +0000 (-0400) Subject: staging: unisys: visorbus: add error handling to error_show X-Git-Tag: v4.14-rc1~980^2~331 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=d9857c794ee858cc6447fcd182da81b5099e5c4d;p=platform%2Fkernel%2Flinux-rpi.git 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 Reviewed-by: Reviewed-by: Tim Sell Signed-off-by: Greg Kroah-Hartman --- diff --git a/drivers/staging/unisys/visorbus/visorchipset.c b/drivers/staging/unisys/visorbus/visorchipset.c index 00fd02f..b09ef4c 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); }