Skip to content

Commit

Permalink
tls: Fixed uninitialised vars warning
Browse files Browse the repository at this point in the history
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: a42055e ("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>
  • Loading branch information
Vakul Garg authored and David S. Miller committed Sep 24, 2018
1 parent 9932a29 commit 4128c0c
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions net/tls/tls_sw.c
Original file line number Diff line number Diff line change
@@ -690,7 +690,7 @@ int tls_sw_sendmsg(struct sock *sk, struct msghdr *msg, size_t size)
int record_room;
int num_zc = 0;
int orig_size;
int ret;
int ret = 0;

if (msg->msg_flags & ~(MSG_MORE | MSG_DONTWAIT | MSG_NOSIGNAL))
return -ENOTSUPP;
@@ -882,8 +882,8 @@ int tls_sw_sendpage(struct sock *sk, struct page *page,
int num_async = 0;
bool full_record;
int record_room;
int ret = 0;
bool eor;
int ret;

if (flags & ~(MSG_MORE | MSG_DONTWAIT | MSG_NOSIGNAL |
MSG_SENDPAGE_NOTLAST))

0 comments on commit 4128c0c

Please sign in to comment.