diff options
author | Dan Carpenter <error27@gmail.com> | 2010-10-14 23:44:07 -0400 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@suse.de> | 2010-10-15 18:41:36 -0400 |
commit | 87b554a04a0d12f8ff3612b6c2e163e29a34616a (patch) | |
tree | 0a219b85566d10724dad8f857a2c6e407e26c0b6 | |
parent | e98cb276819d4c4d6eeaf26ddf627ec8ec9d8f1e (diff) |
Staging: intel_sst: return -EFAULT if copy_to_user() fails
copy_to_user() returns the number of bytes remaining to be copied but we
want to return an error code. And that error code is -EFAULT not -EIO.
Signed-off-by: Dan Carpenter <error27@gmail.com>
Acked-by: Alan Cox <alan@linux.intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
-rw-r--r-- | drivers/staging/intel_sst/intel_sst_app_interface.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/drivers/staging/intel_sst/intel_sst_app_interface.c b/drivers/staging/intel_sst/intel_sst_app_interface.c index 1429386a1c67..b92ce377b102 100644 --- a/drivers/staging/intel_sst/intel_sst_app_interface.c +++ b/drivers/staging/intel_sst/intel_sst_app_interface.c | |||
@@ -861,6 +861,8 @@ long intel_sst_ioctl(struct file *file_ptr, unsigned int cmd, unsigned long arg) | |||
861 | str_info->src = SST_DRV; | 861 | str_info->src = SST_DRV; |
862 | retval = copy_to_user(&str_param->stream_id, | 862 | retval = copy_to_user(&str_param->stream_id, |
863 | &retval, sizeof(__u32)); | 863 | &retval, sizeof(__u32)); |
864 | if (retval) | ||
865 | retval = -EFAULT; | ||
864 | } else { | 866 | } else { |
865 | if (retval == -SST_ERR_INVALID_PARAMS) | 867 | if (retval == -SST_ERR_INVALID_PARAMS) |
866 | retval = -EINVAL; | 868 | retval = -EINVAL; |
@@ -934,7 +936,7 @@ long intel_sst_ioctl(struct file *file_ptr, unsigned int cmd, unsigned long arg) | |||
934 | retval = copy_to_user((struct snd_sst_vol *)arg, | 936 | retval = copy_to_user((struct snd_sst_vol *)arg, |
935 | &get_vol, sizeof(get_vol)); | 937 | &get_vol, sizeof(get_vol)); |
936 | if (retval) { | 938 | if (retval) { |
937 | retval = -EIO; | 939 | retval = -EFAULT; |
938 | break; | 940 | break; |
939 | } | 941 | } |
940 | /*sst_print_get_vol_info(str_id, &get_vol);*/ | 942 | /*sst_print_get_vol_info(str_id, &get_vol);*/ |