All of lore.kernel.org
 help / color / mirror / Atom feed
From: Chuck Lever <cel@kernel.org>
To: netdev@vger.kernel.org
Cc: kernel-tls-handshake@lists.linux.dev, dan.carpenter@linaro.org,
	chuck.lever@oracle.com
Subject: [PATCH v3 3/6] net/handshake: Fix uninitialized local variable
Date: Thu, 11 May 2023 11:48:13 -0400	[thread overview]
Message-ID: <168382008303.84244.4050103332725966411.stgit@91.116.238.104.host.secureserver.net> (raw)
In-Reply-To: <168381978252.84244.1933636428135211300.stgit@91.116.238.104.host.secureserver.net>

From: Chuck Lever <chuck.lever@oracle.com>

trace_handshake_cmd_done_err() simply records the pointer in @req,
so initializing it to NULL is sufficient and safe.

Reported-by: Dan Carpenter <dan.carpenter@linaro.org>
Fixes: 3b3009ea8abb ("net/handshake: Create a NETLINK service for handling handshake requests")
Reviewed-by: Simon Horman <simon.horman@corigine.com>
Signed-off-by: Chuck Lever <chuck.lever@oracle.com>
---
 net/handshake/netlink.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/net/handshake/netlink.c b/net/handshake/netlink.c
index f5dc170689d9..16a4bde648ba 100644
--- a/net/handshake/netlink.c
+++ b/net/handshake/netlink.c
@@ -157,8 +157,8 @@ int handshake_nl_accept_doit(struct sk_buff *skb, struct genl_info *info)
 int handshake_nl_done_doit(struct sk_buff *skb, struct genl_info *info)
 {
 	struct net *net = sock_net(skb->sk);
+	struct handshake_req *req = NULL;
 	struct socket *sock = NULL;
-	struct handshake_req *req;
 	int fd, status, err;
 
 	if (GENL_REQ_ATTR_CHECK(info, HANDSHAKE_A_DONE_SOCKFD))



  parent reply	other threads:[~2023-05-11 15:48 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-05-11 15:46 [PATCH v3 0/6] Bug fixes for net/handshake Chuck Lever
2023-05-11 15:47 ` [PATCH v3 1/6] net/handshake: Remove unneeded check from handshake_dup() Chuck Lever
2023-05-11 15:47 ` [PATCH v3 2/6] net/handshake: Fix handshake_dup() ref counting Chuck Lever
2023-05-11 15:48 ` Chuck Lever [this message]
2023-05-11 15:48 ` [PATCH v3 4/6] net/handshake: handshake_genl_notify() shouldn't ignore @flags Chuck Lever
2023-05-11 15:49 ` [PATCH v3 5/6] net/handshake: Unpin sock->file if a handshake is cancelled Chuck Lever
2023-05-11 15:49 ` [PATCH v3 6/6] net/handshake: Enable the SNI extension to work properly Chuck Lever
2023-05-12  8:30 ` [PATCH v3 0/6] Bug fixes for net/handshake patchwork-bot+netdevbpf
2023-05-25  5:20 ` patchwork-bot+netdevbpf

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=168382008303.84244.4050103332725966411.stgit@91.116.238.104.host.secureserver.net \
    --to=cel@kernel.org \
    --cc=chuck.lever@oracle.com \
    --cc=dan.carpenter@linaro.org \
    --cc=kernel-tls-handshake@lists.linux.dev \
    --cc=netdev@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.