lkml.org 
[lkml]   [2015]   [Sep]   [14]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH RFC v3 1/6] exterr: Introduce extended syscall error reporting
One more little thing:

> +int ext_err_copy_to_user(void __user *buf, size_t size)
> +{

[...]

> + ret = copy_to_user(buf, output, len + 1);
> +
> + kfree(output);
> +
> + if (!ret)
> + current->ext_err_code = 0;
> +
> + return ret ? ret : len + 1;
> +}

I'm pretty sure you really want something like:

return ret ? -EFAULT : (len + 1);

here.

jon


\
 
 \ /
  Last update: 2015-09-15 00:21    [W:0.069 / U:0.524 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site