diff options
author | Vakul Garg <vakul.garg@nxp.com> | 2018-09-24 06:39:49 -0400 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2018-09-24 15:24:52 -0400 |
commit | 4128c0cfb1d74cb1fa2a2fb6824348b349d30f04 (patch) | |
tree | eff037f4f01dd804bbb808073658d184765d5b31 /net/tls | |
parent | 9932a29ab1be1427a2ccbdf852a0f131f2849685 (diff) |
tls: Fixed uninitialised vars warning
In tls_sw_sendmsg() and tls_sw_sendpage(), it is possible that the
uninitialised variable 'ret' gets passed to sk_stream_error(). So
initialise local variable 'ret' to '0. The warnings were detected by
'smatch' tool.
Fixes: a42055e8d2c3 ("net/tls: Add support for async encryption")
Signed-off-by: Vakul Garg <vakul.garg@nxp.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/tls')
-rw-r--r-- | net/tls/tls_sw.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/net/tls/tls_sw.c b/net/tls/tls_sw.c index d30d65bf0753..bf03f32aa983 100644 --- a/net/tls/tls_sw.c +++ b/net/tls/tls_sw.c | |||
@@ -690,7 +690,7 @@ int tls_sw_sendmsg(struct sock *sk, struct msghdr *msg, size_t size) | |||
690 | int record_room; | 690 | int record_room; |
691 | int num_zc = 0; | 691 | int num_zc = 0; |
692 | int orig_size; | 692 | int orig_size; |
693 | int ret; | 693 | int ret = 0; |
694 | 694 | ||
695 | if (msg->msg_flags & ~(MSG_MORE | MSG_DONTWAIT | MSG_NOSIGNAL)) | 695 | if (msg->msg_flags & ~(MSG_MORE | MSG_DONTWAIT | MSG_NOSIGNAL)) |
696 | return -ENOTSUPP; | 696 | return -ENOTSUPP; |
@@ -882,8 +882,8 @@ int tls_sw_sendpage(struct sock *sk, struct page *page, | |||
882 | int num_async = 0; | 882 | int num_async = 0; |
883 | bool full_record; | 883 | bool full_record; |
884 | int record_room; | 884 | int record_room; |
885 | int ret = 0; | ||
885 | bool eor; | 886 | bool eor; |
886 | int ret; | ||
887 | 887 | ||
888 | if (flags & ~(MSG_MORE | MSG_DONTWAIT | MSG_NOSIGNAL | | 888 | if (flags & ~(MSG_MORE | MSG_DONTWAIT | MSG_NOSIGNAL | |
889 | MSG_SENDPAGE_NOTLAST)) | 889 | MSG_SENDPAGE_NOTLAST)) |