Commit c294ea31 authored by Erik Arfvidson's avatar Erik Arfvidson Committed by Greg Kroah-Hartman

staging: unisys: visorbus change -1 return values

This patch changes the vague -1 return values to -EFAULT since
it would be the most appropriate, given that this error
would only occur in an unexpected bad offset field.
Resulting in a bad address.
Signed-off-by: default avatarErik Arfvidson <erik.arfvidson@unisys.com>
Signed-off-by: default avatarDavid Kershner <david.kershner@unisys.com>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent ba78c470
...@@ -876,10 +876,10 @@ write_vbus_chp_info(struct visorchannel *chan, ...@@ -876,10 +876,10 @@ write_vbus_chp_info(struct visorchannel *chan,
int off = sizeof(struct channel_header) + hdr_info->chp_info_offset; int off = sizeof(struct channel_header) + hdr_info->chp_info_offset;
if (hdr_info->chp_info_offset == 0) if (hdr_info->chp_info_offset == 0)
return -1; return -EFAULT;
if (visorchannel_write(chan, off, info, sizeof(*info)) < 0) if (visorchannel_write(chan, off, info, sizeof(*info)) < 0)
return -1; return -EFAULT;
return 0; return 0;
} }
...@@ -895,10 +895,10 @@ write_vbus_bus_info(struct visorchannel *chan, ...@@ -895,10 +895,10 @@ write_vbus_bus_info(struct visorchannel *chan,
int off = sizeof(struct channel_header) + hdr_info->bus_info_offset; int off = sizeof(struct channel_header) + hdr_info->bus_info_offset;
if (hdr_info->bus_info_offset == 0) if (hdr_info->bus_info_offset == 0)
return -1; return -EFAULT;
if (visorchannel_write(chan, off, info, sizeof(*info)) < 0) if (visorchannel_write(chan, off, info, sizeof(*info)) < 0)
return -1; return -EFAULT;
return 0; return 0;
} }
...@@ -915,10 +915,10 @@ write_vbus_dev_info(struct visorchannel *chan, ...@@ -915,10 +915,10 @@ write_vbus_dev_info(struct visorchannel *chan,
(hdr_info->device_info_struct_bytes * devix); (hdr_info->device_info_struct_bytes * devix);
if (hdr_info->dev_info_offset == 0) if (hdr_info->dev_info_offset == 0)
return -1; return -EFAULT;
if (visorchannel_write(chan, off, info, sizeof(*info)) < 0) if (visorchannel_write(chan, off, info, sizeof(*info)) < 0)
return -1; return -EFAULT;
return 0; return 0;
} }
......
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