Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

net/handshake: Fix uninitialized local variable

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>
Signed-off-by: Jakub Kicinski <kuba@kernel.org>

authored by

Chuck Lever and committed by
Jakub Kicinski
7afc6d0a 7ea9c1ec

+1 -1
+1 -1
net/handshake/netlink.c
··· 157 157 int handshake_nl_done_doit(struct sk_buff *skb, struct genl_info *info) 158 158 { 159 159 struct net *net = sock_net(skb->sk); 160 + struct handshake_req *req = NULL; 160 161 struct socket *sock = NULL; 161 - struct handshake_req *req; 162 162 int fd, status, err; 163 163 164 164 if (GENL_REQ_ATTR_CHECK(info, HANDSHAKE_A_DONE_SOCKFD))