From c294ea31aa785afe2144fc933fd59106506c1c53 Mon Sep 17 00:00:00 2001 From: Erik Arfvidson Date: Fri, 13 May 2016 23:17:19 -0400 Subject: [PATCH] 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: Erik Arfvidson Signed-off-by: David Kershner Signed-off-by: Greg Kroah-Hartman --- drivers/staging/unisys/visorbus/visorbus_main.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/drivers/staging/unisys/visorbus/visorbus_main.c b/drivers/staging/unisys/visorbus/visorbus_main.c index 3a147dbbd7b5..d32b8980a1cf 100644 --- a/drivers/staging/unisys/visorbus/visorbus_main.c +++ b/drivers/staging/unisys/visorbus/visorbus_main.c @@ -876,10 +876,10 @@ write_vbus_chp_info(struct visorchannel *chan, int off = sizeof(struct channel_header) + hdr_info->chp_info_offset; if (hdr_info->chp_info_offset == 0) - return -1; + return -EFAULT; if (visorchannel_write(chan, off, info, sizeof(*info)) < 0) - return -1; + return -EFAULT; return 0; } @@ -895,10 +895,10 @@ write_vbus_bus_info(struct visorchannel *chan, int off = sizeof(struct channel_header) + hdr_info->bus_info_offset; if (hdr_info->bus_info_offset == 0) - return -1; + return -EFAULT; if (visorchannel_write(chan, off, info, sizeof(*info)) < 0) - return -1; + return -EFAULT; return 0; } @@ -915,10 +915,10 @@ write_vbus_dev_info(struct visorchannel *chan, (hdr_info->device_info_struct_bytes * devix); if (hdr_info->dev_info_offset == 0) - return -1; + return -EFAULT; if (visorchannel_write(chan, off, info, sizeof(*info)) < 0) - return -1; + return -EFAULT; return 0; } -- 2.30.2