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>
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;
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);*/