Skip to content

Commit 49b2b97

Browse files
mmhalPaolo Abeni
authored andcommitted
net: Comment copy_from_sockptr() explaining its behaviour
copy_from_sockptr() has a history of misuse. Add a comment explaining that the function follows API of copy_from_user(), i.e. returns 0 for success, or number of bytes not copied on error. Signed-off-by: Michal Luczaj <mhal@rbox.co> Signed-off-by: Paolo Abeni <pabeni@redhat.com>
1 parent 0202005 commit 49b2b97

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

include/linux/sockptr.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,8 @@ static inline int copy_from_sockptr_offset(void *dst, sockptr_t src,
5353
/* Deprecated.
5454
* This is unsafe, unless caller checked user provided optlen.
5555
* Prefer copy_safe_from_sockptr() instead.
56+
*
57+
* Returns 0 for success, or number of bytes not copied on error.
5658
*/
5759
static inline int copy_from_sockptr(void *dst, sockptr_t src, size_t size)
5860
{

0 commit comments

Comments
 (0)