Commit 711c67f4 authored by David Kershner's avatar David Kershner Committed by Greg Kroah-Hartman

staging: unisys: visorbus: don't ignore visorchannel_read error

Don't override the visorchannel_read_error, just return the
error that it generates.
Signed-off-by: default avatarDavid Kershner <david.kershner@unisys.com>
Reviewed-by: default avatarReviewed-by: Tim Sell <timothy.sell@unisys.com>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent e0d210ae
......@@ -691,6 +691,8 @@ static int
get_vbus_header_info(struct visorchannel *chan,
struct spar_vbus_headerinfo *hdr_info)
{
int err;
if (!spar_check_channel(visorchannel_get_header(chan),
spar_vbus_channel_protocol_uuid,
"vbus",
......@@ -699,10 +701,11 @@ get_vbus_header_info(struct visorchannel *chan,
SPAR_VBUS_CHANNEL_PROTOCOL_SIGNATURE))
return -EINVAL;
if (visorchannel_read(chan, sizeof(struct channel_header), hdr_info,
sizeof(*hdr_info)) < 0) {
return -EIO;
}
err = visorchannel_read(chan, sizeof(struct channel_header), hdr_info,
sizeof(*hdr_info));
if (err < 0)
return err;
if (hdr_info->struct_bytes < sizeof(struct spar_vbus_headerinfo))
return -EINVAL;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment