diff options
author | Dan Carpenter <error27@gmail.com> | 2010-10-15 03:44:07 (GMT) |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@suse.de> | 2010-10-15 22:41:36 (GMT) |
commit | 87b554a04a0d12f8ff3612b6c2e163e29a34616a (patch) | |
tree | 0a219b85566d10724dad8f857a2c6e407e26c0b6 /drivers | |
parent | e98cb276819d4c4d6eeaf26ddf627ec8ec9d8f1e (diff) | |
download | linux-87b554a04a0d12f8ff3612b6c2e163e29a34616a.tar.xz |
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>
Diffstat (limited to 'drivers')
-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 1429386..b92ce37 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) str_info->src = SST_DRV; retval = copy_to_user(&str_param->stream_id, &retval, sizeof(__u32)); + if (retval) + retval = -EFAULT; } else { if (retval == -SST_ERR_INVALID_PARAMS) retval = -EINVAL; @@ -934,7 +936,7 @@ long intel_sst_ioctl(struct file *file_ptr, unsigned int cmd, unsigned long arg) retval = copy_to_user((struct snd_sst_vol *)arg, &get_vol, sizeof(get_vol)); if (retval) { - retval = -EIO; + retval = -EFAULT; break; } /*sst_print_get_vol_info(str_id, &get_vol);*/ |