Skip to content

Commit

Permalink
net/handshake: Fix uninitialized local variable
Browse files Browse the repository at this point in the history
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: 3b3009e ("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>
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
  • Loading branch information
chucklever authored and kuba-moo committed May 25, 2023
1 parent 7ea9c1e commit 7afc6d0
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion net/handshake/netlink.c
Original file line number Diff line number Diff line change
Expand Up @@ -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))
Expand Down

0 comments on commit 7afc6d0

Please sign in to comment.