Received: by 2002:a05:7412:2a8a:b0:fc:a2b0:25d7 with SMTP id u10csp367581rdh; Wed, 7 Feb 2024 07:08:25 -0800 (PST) X-Google-Smtp-Source: AGHT+IHjwT2abepECKHbWSThItaN3M6sqyuFmoydfCVfuJYOsOkQGVS8dTxYEk7Tf2VYf9eaQYrR X-Received: by 2002:a05:6214:d47:b0:68c:75e8:b8cb with SMTP id 7-20020a0562140d4700b0068c75e8b8cbmr7014647qvr.29.1707318504814; Wed, 07 Feb 2024 07:08:24 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1707318504; cv=pass; d=google.com; s=arc-20160816; b=xPNmor3L/FyIi98qunT1MgFocp4f/t+FZ1V80PvGON2tGNvmC4T+ENl7kXJFm971RI ljb1qDvREQofk+dRm3uPNVWshbiZ9CskY4PwqWyiPrWX2j/yRqY+Ilh1WiFj5/oInByR 7ecwZVlM043MpSvL5jEIb8UYNdSykPXnVQX9L2kHnH4s1uu1Khe7nZAFNihgULKaKhUt 8ChCN46bMbO9HG7yBStbzhCM/zZiPRiaqR5ZdFG6OTWyX87jhv+wJ/WK/9gwpV5Epo3b jE/aJNm7V931AsUdaTJRDQVbGarW4taXQ4mVwusGS3tPQ0YRujCPUmKQ0D+gfcvph5bi 6KMg== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=date:message-id:user-agent:cc:to:references:in-reply-to:from :subject:content-transfer-encoding:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:dkim-signature; bh=rlRPdvHa5Hmi+2+vmMoo2vGBFo+9I9Qg+aIo1X/DXpw=; fh=07YYG8179TF621Zzzp1ukI+qYiFP5GAI6Lvi/dQOJ60=; b=voS3EhMRZIe2jdVozgtNGUl6pzB01GW9tuXOsJ6kIhWRDBU8s2LI+f952B+tEbBoMV yBMSBKk+ghwjHfkVwRif7C8KX/MGSmEtYoV2JePKQl25cWiQNmm5wYx+iPQO7JLt6ZD+ uDIXXgEfYyoK6KZ1HRsRloaK4CPta2n+1sBxNyE7qN+2ChlczxZnn0rgTxWAaAtbRoRm XRvzWi44u2QQkUEda1TD2+F1bSMax94i07N3dEFgSMvRQOxhG+3b2PwvC3slQOVDZnY9 vLdfMLnDctIjtMmKngokLs6veF/0XBAjCGA2tNE741VauVWedTyaULFYUP/nbkUFYSxS MsFQ==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=VD+Ura7k; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-wireless+bounces-3294-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-wireless+bounces-3294-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org X-Forwarded-Encrypted: i=2; AJvYcCXpDBVufq4oCyAH26sBhXAUEmQmdERWyFAtk+jV6GwGY9bPo+Y+3zKqFL8H6HUvWYZkw2qaNETzYjcWt6s1oOkTthUMXvw9S6tb3BFsDw== Return-Path: Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [2604:1380:45d1:ec00::1]) by mx.google.com with ESMTPS id 2-20020a0562140cc200b0068177d8f440si1393959qvx.229.2024.02.07.07.08.24 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 07 Feb 2024 07:08:24 -0800 (PST) Received-SPF: pass (google.com: domain of linux-wireless+bounces-3294-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) client-ip=2604:1380:45d1:ec00::1; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=VD+Ura7k; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-wireless+bounces-3294-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-wireless+bounces-3294-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org 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 ny.mirrors.kernel.org (Postfix) with ESMTPS id E23591C25284 for ; Wed, 7 Feb 2024 15:08:18 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id A8DFA7F48C; Wed, 7 Feb 2024 15:08:16 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="VD+Ura7k" X-Original-To: linux-wireless@vger.kernel.org Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 7AC1C7E791; Wed, 7 Feb 2024 15:08:16 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1707318496; cv=none; b=DwhnTU5GsEK+6ticAISkPtuzJfpSY9FwA+b4YmdmLHmRQ45IXqHaIHYduEltUuJQtVWN3/V6B72d5YRoMCvlgd2R2M5qlrJgLynaI6ELjjCDIXg4sf6FbrXklg/5FwS9ZNsuCS2GU8vnuhE2DxSzrIUdNQkJrQ2BOmSGjajDEVo= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1707318496; c=relaxed/simple; bh=y/x282TGyBYCjdhcKYKHYG/kynm2rucyoPS3V5ieUbM=; h=Content-Type:MIME-Version:Subject:From:In-Reply-To:References:To: Cc:Message-ID:Date; b=l13NEFv7dXiTPKc9lJaBzpOXGhiVPPF2iwkroW+sIUx+dedxwkODLvDUZeVidQ0ewGSkaLQuuvmG82gNPJQ6taoXTheixe6mMlUikPSa9A9WDFeYfBAnfuMrqLUwcfjwKk/Y7KD8zhTa7vTtraMVzFDfE5bb9+tRmgtBH+HmEks= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=VD+Ura7k; arc=none smtp.client-ip=10.30.226.201 Received: by smtp.kernel.org (Postfix) with ESMTPSA id 3AB68C433C7; Wed, 7 Feb 2024 15:08:14 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1707318496; bh=y/x282TGyBYCjdhcKYKHYG/kynm2rucyoPS3V5ieUbM=; h=Subject:From:In-Reply-To:References:To:Cc:Date:From; b=VD+Ura7ktRstWIYsHIa0uBGaRlrylJuQiMb0G/Z1Ou/klx3BKPrNCku8O1PnAr1UU rvp/vWbyITQnsJpu6D0bAB2etGy+Jbz1Sg0TxzhabyHBx3/EM1OHrG3m36ha5EumsV S+Q/7b38B4inl0Pw3jRCNOqCHK4PYZcb0e7lmHvDjw4GFKD7rPTj+AcLx5BupeHXCH Uc+/e8h83XnknucKPCfn4oFURhl7giw8RzjKTPTXLYp9kBcXEluB06St/WY5frZlcO h5tm2ekwL3m/MMf/j+w6iLZp9qqcgCYebibORvCinj+uiNxqiF3sAJyp0Abj9RvDlR HNfC1dJlP4NTA== Content-Type: text/plain; charset="utf-8" Precedence: bulk X-Mailing-List: linux-wireless@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: Re: [PATCH] wifi: ath12k: Fix uninitialized use of ret in ath12k_mac_allocate() From: Kalle Valo In-Reply-To: <20240205-ath12k-mac-wuninitialized-v1-1-3fda7b17357f@kernel.org> References: <20240205-ath12k-mac-wuninitialized-v1-1-3fda7b17357f@kernel.org> To: Nathan Chancellor Cc: quic_jjohnson@quicinc.com, morbo@google.com, justinstitt@google.com, quic_periyasa@quicinc.com, ath12k@lists.infradead.org, linux-wireless@vger.kernel.org, llvm@lists.linux.dev, patches@lists.linux.dev, Nathan Chancellor User-Agent: pwcli/0.1.1-git (https://github.com/kvalo/pwcli/) Python/3.11.2 Message-ID: <170731849247.2220494.17976129376947521581.kvalo@kernel.org> Date: Wed, 7 Feb 2024 15:08:14 +0000 (UTC) Nathan Chancellor wrote: > Clang warns (or errors with CONFIG_WERROR=y): > > drivers/net/wireless/ath/ath12k/mac.c:8060:9: error: variable 'ret' is uninitialized when used here [-Werror,-Wuninitialized] > 8060 | return ret; > | ^~~ > drivers/net/wireless/ath/ath12k/mac.c:8022:9: note: initialize the variable 'ret' to silence this warning > 8022 | int ret, i, j; > | ^ > | = 0 > 1 error generated. > > Commit 6db6e70a17f6 ("wifi: ath12k: Introduce the container for mac80211 > hw") added a completely uninitialized use of ret. Prior to that change, > -ENOMEM was returned to the callers of ath12k_mac_allocate() whenever > ath12k_mac_hw_allocate() failed. Assign that value to ret to make sure > it is always initialized when used and clear up the warning. > > Closes: https://github.com/ClangBuiltLinux/linux/issues/1989i > Fixes: 6db6e70a17f6 ("wifi: ath12k: Introduce the container for mac80211 hw") > Signed-off-by: Nathan Chancellor > Acked-by: Jeff Johnson > Signed-off-by: Kalle Valo Patch applied to ath-next branch of ath.git, thanks. 04edb5dc68f4 wifi: ath12k: Fix uninitialized use of ret in ath12k_mac_allocate() -- https://patchwork.kernel.org/project/linux-wireless/patch/20240205-ath12k-mac-wuninitialized-v1-1-3fda7b17357f@kernel.org/ https://wireless.wiki.kernel.org/en/developers/documentation/submittingpatches