gcc10 with LTO finds a path where process_iwpm_wire_request() calls copy_iwpm_sockaddr() and then does print_iwpm_sockaddr() against the dst. If the case statement in copy_iwpm_sockaddr() bails then print_iwpm_sockaddr() is still called and this triggers a read from uninitialized memory. Always copy the ss_family, this will cause the default case to be taken in print_iwpm_sockaddr() as well. Signed-off-by: Jason Gunthorpe <jgg@xxxxxxxxxx> --- iwpmd/iwarp_pm_common.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/iwpmd/iwarp_pm_common.c b/iwpmd/iwarp_pm_common.c index 8160180aee48e8..67309cbee6a057 100644 --- a/iwpmd/iwarp_pm_common.c +++ b/iwpmd/iwarp_pm_common.c @@ -570,6 +570,10 @@ void copy_iwpm_sockaddr(__u16 addr_family, struct sockaddr_storage *src_sockaddr *dst = *src; break; } + default: + assert(false); + if (dst_sockaddr) + dst_sockaddr->ss_family = addr_family; } } -- 2.29.2