tls: return -EFAULT if copy_to_user() fails
authorDan Carpenter <dan.carpenter@oracle.com>
Fri, 23 Jun 2017 10:15:44 +0000 (13:15 +0300)
committerDavid S. Miller <davem@davemloft.net>
Fri, 23 Jun 2017 18:19:27 +0000 (14:19 -0400)
commitac55cd619335c577f29eea599a6a35b6b48797e8
treeee7e30c96b95f528ac7e5299f159d49a6b5490b4
parent93bbbfbb4a5aa32a2375a86f3a23e48ea75e05db
tls: return -EFAULT if copy_to_user() fails

The copy_to_user() function returns the number of bytes remaining but we
want to return -EFAULT here.

Fixes: 3c4d7559159b ("tls: kernel TLS support")
Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Acked-by: Dave Watson <davejwatson@fb.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
net/tls/tls_main.c