Received: by 2002:a89:288:0:b0:1f7:eeee:6653 with SMTP id j8csp96255lqh; Mon, 6 May 2024 12:23:58 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCUqQhQHr73xPhRBAVm2+WKQ+uhYQ7n6Tfdd0VLcDKJDr68hPhYaULi1NfCR54/liIjQ+z+w7HCnhHsbsJL7IhuEnZTIckDsYEinXgr8Kw== X-Google-Smtp-Source: AGHT+IFLkICif8dTJcLOZn1zQECs9qVocOLSFEbTh5Hu4exq/Z26R4AynyjsPaRifBRU+5p62a54 X-Received: by 2002:a17:902:d4cf:b0:1ec:c906:b86e with SMTP id o15-20020a170902d4cf00b001ecc906b86emr12593779plg.28.1715023437656; Mon, 06 May 2024 12:23:57 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1715023437; cv=pass; d=google.com; s=arc-20160816; b=PPESiib/SH1LvcC966Ez/LtbEy1Qs/c1IqJhJmfeQ0nEalbqTdqhe2PO3EN3O177HA ElOR6KVZaWWM3VgmJrI+WdGWbeyEkA/EFc6DrDM+M5BbEOA8eu1kTFeJFhYod+xDT9LE 9uIR0hh67lhWAVi8fpKVcqaDuJ9umS67e9sxG9CllNZjWF9P/Ad3Hm8ewe4/GRHKxz7J CSFZ2bx5AFOsnxuBttnlb3zzf7LRJlNwF7odY6NZ36CUG3paY8nZin+7CgMlGVsDx+H6 muCrvewRZCpinw/73pjGy8M6j2SJewFLJwNcekvY4YPWsjNLxHvEVLFOgjHFC3H5Omjb 4YQQ== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:subject:references:in-reply-to :message-id:cc:to:from:date:dkim-signature; bh=HMEDQp7jecrc8iXiBOXlaMlkv7t0FOpm2f19JeLxtsA=; fh=tjhLmvQl/kv5pn2p/X9bnGwytnAOAnyIdP7Z64X5Qx4=; b=dZEZVK1rRJEoOotZcKXM2/YCTk2j7LJFcfahOTBbvT6dXlNFWkOeo8VOTf4G638Nxr qGqBQ2RtOZxrMBZkOcJUq41GN3BHsm+dGDpN/xKwmASqH0xBsyDmWqvVGYH2yCfWh0XV uTStHoqH01skfYc1SlJZY9wkIQigmpUTKTsUSco35ijjRHsC19dBqhyLdQvzM4UaQQuT jngABxzGMFr2AIb1Ar9ZUbev3JkY6Sj8Yylya0QjaCM6JGDAP/p7Kncxr5bm8AWmvLie AFtXfCiZYekcCtMJ8CUQXP21v63DMnpvTKGXyzLYs1iy8ogJ2YqRgxAYFqu6MDlVlOiE 6kHQ==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@gmail.com header.s=20230601 header.b=cGpr+Ki1; arc=pass (i=1 spf=pass spfdomain=gmail.com dkim=pass dkdomain=gmail.com dmarc=pass fromdomain=gmail.com); spf=pass (google.com: domain of linux-kernel+bounces-170333-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-kernel+bounces-170333-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org. [139.178.88.99]) by mx.google.com with ESMTPS id s18-20020a170903201200b001e79bbfe7f1si8436526pla.262.2024.05.06.12.23.57 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 06 May 2024 12:23:57 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-170333-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) client-ip=139.178.88.99; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20230601 header.b=cGpr+Ki1; arc=pass (i=1 spf=pass spfdomain=gmail.com dkim=pass dkdomain=gmail.com dmarc=pass fromdomain=gmail.com); spf=pass (google.com: domain of linux-kernel+bounces-170333-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-kernel+bounces-170333-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by sv.mirrors.kernel.org (Postfix) with ESMTPS id 43E91283A84 for ; Mon, 6 May 2024 19:23:57 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id A9C761591F5; Mon, 6 May 2024 19:23:49 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="cGpr+Ki1" Received: from mail-oa1-f46.google.com (mail-oa1-f46.google.com [209.85.160.46]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 92A0A158A2B; Mon, 6 May 2024 19:23:47 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.160.46 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1715023428; cv=none; b=Dk8Ty4m/KLuicZ4zLtZHFdHFZnDWvpVwzNx8tiSKXVoIFj2py5lCDSxNtzFavi5hTCxZMeFwxFSenJCeMe8JJ5lM2mQsMkJozsxvUX7wlhrxJ0RPp/qa6/mE3xxx6Pq0M+ASb93RXRKRvinaRFr3KA09Gu7QzsCgFvS0qEKDUXo= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1715023428; c=relaxed/simple; bh=VjKGuE2C0thOxnAgsCwVrGWxtDbyC3SnKsv1KFItiOk=; h=Date:From:To:Cc:Message-ID:In-Reply-To:References:Subject: Mime-Version:Content-Type; b=bauFyQlaLraV6Z81ZrpUStqYOfrSCTmxAKQbNojHXR4/EXsnMHQzmnimlYxtOCxaowbR/Glr0c4MCtnvqbpJWCyuf4Sa6kUWnIPyhJ/F4nnBM0rFv7C31pwvldmRbFk7qGZdqdckOObaTlX5SkGGJiRIQ7lHchuANAHsm05UtvY= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=cGpr+Ki1; arc=none smtp.client-ip=209.85.160.46 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Received: by mail-oa1-f46.google.com with SMTP id 586e51a60fabf-23d1c4c14ceso1594145fac.0; Mon, 06 May 2024 12:23:47 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1715023426; x=1715628226; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:subject:references :in-reply-to:message-id:cc:to:from:date:from:to:cc:subject:date :message-id:reply-to; bh=HMEDQp7jecrc8iXiBOXlaMlkv7t0FOpm2f19JeLxtsA=; b=cGpr+Ki1Mf2ipnnzIeaUmB2GCJekJz+FVvz65hI04tN6e3WP9AYIpyXKA2yRQwTB/B E3SEDeaJtPrtheIAJxEUvG6AAmcCPuRKrcsp2OO4aQO5biv+6a3N0/Yr9+j4qYHQbM+Q 5HOTNkIEXO27sQi53M2/oq/bUHTiQcKNsovB32WaN4wOtX3/zG/+TG9+fkD5a8fKM3do 1lpipF7AadPERi8ZGnOVSKASW9KBVz1tVRj++6/VCO0ENFS4FQzXT92GXYUMLGMfxhNw Rp9vcgKsXVBfsW1EqffrzQ/RBbGpUqQM8NcB9LZVKMn315d6YYFcoCuQSu9FNgfdSqMW 9uRg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1715023426; x=1715628226; h=content-transfer-encoding:mime-version:subject:references :in-reply-to:message-id:cc:to:from:date:x-gm-message-state:from:to :cc:subject:date:message-id:reply-to; bh=HMEDQp7jecrc8iXiBOXlaMlkv7t0FOpm2f19JeLxtsA=; b=NTnr9FQPHiyC7tOXGT3R3QH/Bx9aGMuiuOtHNFA3unxdWOs3PlubQMMbSfJbk+aUZe BqkA3hcNFMyTs6nuRQ0zWXzk88zh3frwTtf3OVYgWbSx9AipS26EheWg+IL7k+5GU8f+ f+alklC0hLnM0dl0pjpyYn9TTaQM4+yelr9Yf2k9n2jjPZOYHmP6EcCjnqie7aFTB7gl i4v++rRSqJbI2Hze60hFR+k0z/sFVjJPjOVT4+k9FyE7E4oEDdA8f/0SeadAumUC6zpe U+WoS7mDGl8a56FesHG24qrhGtrlmclIdooS4r4E7dRoSKhz6m7jY5a2KGMesUTvexGm 1akw== X-Forwarded-Encrypted: i=1; AJvYcCUmnJBa9Esf7H7iz6ziDLEtvfUKX73yZNk5MHEgDCHcUv0UL7vVD5wOfSUQwqTnMpvYVMdFgMAF9qIAiXSKnJ5FSZ12VG9E56rPhTsRsUHY2FARRMoMrlq/jkTtKXHGT/r+H5FNz4jJz+e4Kx+3xsEaFIkujNCrSIAO9dOnDdtRR6lANfjT X-Gm-Message-State: AOJu0YwreOn/linyfjWi6E9TGmNo9CfyTUtWYp1PM2ol+O2Xr/xuXt/N xmvwT3Ad2pwUE+6XsA/8ud0Fuv4OR7+kEXrGqpUDBkZsZeOx6i6L X-Received: by 2002:a05:6870:8898:b0:22e:b96a:375 with SMTP id m24-20020a056870889800b0022eb96a0375mr13017922oam.30.1715023426523; Mon, 06 May 2024 12:23:46 -0700 (PDT) Received: from localhost (164.146.150.34.bc.googleusercontent.com. [34.150.146.164]) by smtp.gmail.com with ESMTPSA id m24-20020ae9e718000000b0078d5e60b52esm4137182qka.114.2024.05.06.12.23.46 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 06 May 2024 12:23:46 -0700 (PDT) Date: Mon, 06 May 2024 15:23:45 -0400 From: Willem de Bruijn To: John Hubbard , Shuah Khan Cc: "David S . Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , Steffen Klassert , Herbert Xu , =?UTF-8?B?QW5kcmVhcyBGw6RyYmVy?= , Manivannan Sadhasivam , Matthieu Baerts , Mat Martineau , Geliang Tang , Pravin B Shelar , Willem de Bruijn , Alexander Mikhalitsyn , zhujun2 , Petr Machata , Ido Schimmel , Hangbin Liu , Nikolay Aleksandrov , Benjamin Poirier , Sebastian Andrzej Siewior , Dmitry Safonov <0x7f454c46@gmail.com>, netdev@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-actions@lists.infradead.org, mptcp@lists.linux.dev, dev@openvswitch.org, Valentin Obst , linux-kselftest@vger.kernel.org, LKML , llvm@lists.linux.dev, John Hubbard Message-ID: <66392e41e6889_55f25294dc@willemb.c.googlers.com.notmuch> In-Reply-To: <20240506190204.28497-1-jhubbard@nvidia.com> References: <20240506190204.28497-1-jhubbard@nvidia.com> Subject: Re: [PATCH v2] selftests/net: fix uninitialized variables Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit John Hubbard wrote: > When building with clang, via: > > make LLVM=1 -C tools/testing/selftest > > ...clang warns about three variables that are not initialized in all > cases: > > 1) The opt_ipproto_off variable is used uninitialized if "testname" is > not "ip". Willem de Bruijn pointed out that this is an actual bug, and > suggested the fix that I'm using here (thanks!). > > 2) The addr_len is used uninitialized, but only in the assert case, > which bails out, so this is harmless. > > 3) The family variable in add_listener() is only used uninitialized in > the error case (neither IPv4 nor IPv6 is specified), so it's also > harmless. > > Fix by initializing each variable. > > Cc: Willem de Bruijn > Signed-off-by: John Hubbard Reviewed-by: Willem de Bruijn Thanks!