All of lore.kernel.org
 help / color / mirror / Atom feed
From: Nathan Chancellor <nathan@kernel.org>
To: Remi Denis-Courmont <courmisch@gmail.com>,
	"David S. Miller" <davem@davemloft.net>,
	Eric Dumazet <edumazet@google.com>,
	Jakub Kicinski <kuba@kernel.org>, Paolo Abeni <pabeni@redhat.com>,
	Simon Horman <horms@kernel.org>
Cc: netdev@vger.kernel.org, llvm@lists.linux.dev
Subject: -Wuninitialized-const-pointer in net/phonet/pep.c
Date: Tue, 15 Jul 2025 13:16:37 -0700	[thread overview]
Message-ID: <20250715201637.GA2104822@ax162> (raw)

Hi all,

A new warning in clang [1] points out that dst is not initialized when
passed to pep_find_pipe() in pep_sock_accept():

  net/phonet/pep.c:829:37: error: variable 'dst' is uninitialized when passed as a const pointer argument here [-Werror,-Wuninitialized-const-pointer]
    829 |         newsk = pep_find_pipe(&pn->hlist, &dst, pipe_handle);
        |                                            ^~~

It looks like this was introduced by commit f7ae8d59f661 ("Phonet:
allocate sock from accept syscall rather than soft IRQ") if I understand
correctly. Prior to that change, both calls to pep_find_pipe() were in
the same function with pn_skb_get_dst_sockaddr(skb, &dst) before them,
so dst would always be initialized. Should pn_skb_get_dst_sockaddr() be
called before pep_find_pipe() in pep_sock_accept() as well or is there
some other fix for this? I am not familiar with this code, hence the
inquiry.

[1]: https://github.com/llvm/llvm-project/commit/00dacf8c22f065cb52efb14cd091d441f19b319e

Cheers,
Nathan

             reply	other threads:[~2025-07-15 20:16 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-07-15 20:16 Nathan Chancellor [this message]
2025-07-15 22:14 ` -Wuninitialized-const-pointer in net/phonet/pep.c Kuniyuki Iwashima

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=20250715201637.GA2104822@ax162 \
    --to=nathan@kernel.org \
    --cc=courmisch@gmail.com \
    --cc=davem@davemloft.net \
    --cc=edumazet@google.com \
    --cc=horms@kernel.org \
    --cc=kuba@kernel.org \
    --cc=llvm@lists.linux.dev \
    --cc=netdev@vger.kernel.org \
    --cc=pabeni@redhat.com \
    /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.