Re: [PATCH 6/9] staging: vme_user: return -EFAULT on __copy_*_user errors

From: Dmitry Kalinkin
Date: Tue Jun 23 2015 - 10:11:54 EST



> On 23 Jun 2015, at 16:51, Dan Carpenter <dan.carpenter@xxxxxxxxxx> wrote:
>
> On Tue, Jun 23, 2015 at 03:42:30PM +0300, Dmitry Kalinkin wrote:
>> @@ -178,38 +167,24 @@ static ssize_t buffer_to_user(unsigned int minor, char __user *buf,
>> size_t count, loff_t *ppos)
>> {
>> void *image_ptr;
>> - ssize_t retval;
>>
>> image_ptr = image[minor].kern_buf + *ppos;
>> + if (__copy_to_user(buf, image_ptr, (unsigned long)count))
>> + return -EINVAL;
>
> s/EINVAL/EFAULT/

Right. Will fix in v2.

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/