Commit 17ba793
phonet/pep: Move call to pn_skb_get_dst_sockaddr() earlier in pep_sock_accept()
A new warning in clang [1] points out a place in pep_sock_accept() where
dst is uninitialized then passed as a const pointer to pep_find_pipe():
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);
| ^~~:
Move the call to pn_skb_get_dst_sockaddr(), which initializes dst, to
before the call to pep_find_pipe(), so that dst is consistently used
initialized throughout the function.
Cc: [email protected]
Fixes: f7ae8d5 ("Phonet: allocate sock from accept syscall rather than soft IRQ")
Link: llvm/llvm-project@00dacf8 [1]
Closes: ClangBuiltLinux/linux#2101
Signed-off-by: Nathan Chancellor <[email protected]>
Link: https://patch.msgid.link/20250715-net-phonet-fix-uninit-const-pointer-v1-1-8efd1bd188b3@kernel.org
Signed-off-by: Jakub Kicinski <[email protected]>1 parent e49f95d commit 17ba793
1 file changed
+1
-1
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
826 | 826 | | |
827 | 827 | | |
828 | 828 | | |
| 829 | + | |
829 | 830 | | |
830 | 831 | | |
831 | 832 | | |
| |||
850 | 851 | | |
851 | 852 | | |
852 | 853 | | |
853 | | - | |
854 | 854 | | |
855 | 855 | | |
856 | 856 | | |
| |||
0 commit comments