Message ID | 20240909045505.236657-5-mkp@redhat.com |
---|---|
State | Accepted, archived |
Commit | cfc8321da150a1a41368a648221a7d2a2e6262c2 |
Delegated to: | Eelco Chaudron |
Headers | show |
Series | Address clang analyze warnings. | expand |
Context | Check | Description |
---|---|---|
ovsrobot/apply-robot | success | apply and check: success |
ovsrobot/github-robot-_Build_and_Test | success | github build: passed |
On 9 Sep 2024, at 6:55, Mike Pattrick wrote: > The Clang analyzer will alert on the use of uninitialized variable local > despite the fact that this should be set by a syscall. > > To suppress the warning, this variable is now initialized. > > Signed-off-by: Mike Pattrick <mkp@redhat.com> Thanks for sending out the v3, the changes look good to me. Cheers, Eelco Acked-by: Eelco Chaudron <echaudro@redhat.com>
On Mon, Sep 09, 2024 at 12:55:01AM -0400, Mike Pattrick wrote: > The Clang analyzer will alert on the use of uninitialized variable local > despite the fact that this should be set by a syscall. > > To suppress the warning, this variable is now initialized. > > Signed-off-by: Mike Pattrick <mkp@redhat.com> Acked-by: Simon Horman <horms@ovn.org>
diff --git a/lib/netlink-socket.c b/lib/netlink-socket.c index 5cb1fc89a..976ed15e8 100644 --- a/lib/netlink-socket.c +++ b/lib/netlink-socket.c @@ -232,6 +232,7 @@ nl_sock_create(int protocol, struct nl_sock **sockp) } /* Obtain pid assigned by kernel. */ + memset(&local, 0, sizeof local); local_size = sizeof local; if (getsockname(sock->fd, (struct sockaddr *) &local, &local_size) < 0) { VLOG_ERR("getsockname: %s", ovs_strerror(errno));
The Clang analyzer will alert on the use of uninitialized variable local despite the fact that this should be set by a syscall. To suppress the warning, this variable is now initialized. Signed-off-by: Mike Pattrick <mkp@redhat.com> --- lib/netlink-socket.c | 1 + 1 file changed, 1 insertion(+)