From: Chuck Lever Date: Thu, 11 May 2023 15:48:13 +0000 (-0400) Subject: net/handshake: Fix uninitialized local variable X-Git-Tag: v6.6.17~4555^2~292^2~3 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=7301034026d0efe0e86af0cb685405da120583d4;p=platform%2Fkernel%2Flinux-rpi.git 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 Fixes: 3b3009ea8abb ("net/handshake: Create a NETLINK service for handling handshake requests") Reviewed-by: Simon Horman Signed-off-by: Chuck Lever Signed-off-by: David S. Miller --- diff --git a/net/handshake/netlink.c b/net/handshake/netlink.c index f5dc1706..16a4bde 100644 --- a/net/handshake/netlink.c +++ b/net/handshake/netlink.c @@ -157,8 +157,8 @@ out_status: 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))