Received: by 2002:a05:6358:45e:b0:b5:b6eb:e1f9 with SMTP id 30csp3277064rwe; Mon, 29 Aug 2022 08:42:31 -0700 (PDT) X-Google-Smtp-Source: AA6agR7+9Nj8qzpPhhs2Bc5ewvcsSwSokEfm884Dvty7KJWMgLWHOEgBBoOR3Y5ipZHesmJ1Vlqc X-Received: by 2002:a17:906:cc12:b0:741:64ed:125a with SMTP id ml18-20020a170906cc1200b0074164ed125amr5908134ejb.713.1661787750842; Mon, 29 Aug 2022 08:42:30 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1661787750; cv=none; d=google.com; s=arc-20160816; b=XtFOjP7Ah3sbwahP7/MQi1dUtiQFbNfz76uZM5eZZFiwxrN7b9NHWkV+toQOvFy+oC BsvhFHe1Kw4UksIJdVjVCtqWuIxlmQHnMB479TZSj0+Sxh9IZtmws1G/DJduJlsosTXq mk4mUrHE4ehB8pt7EmRJjvvF8eVQzis2QIvgrjU/iyjdGisvUVJKA1LEOx4gs0z3O5Kb TpfvVkm8QpzMPWEqJik9RhyjOwp3ZlTK8w1vz1etbAdfpbFloMf1F2vV5PngSpqoJLyL 4OPS7kpmORNJ/Hm+cUiyl/gfA4tJHkoeRRNg7n0ntRfPof/QLnB+D5dmmFCOxfuxAs2q W2nQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:message-id:date:user-agent :references:in-reply-to:subject:cc:to:from:dkim-signature; bh=rdjH1ROLuIiaJroG6H4PYcLRRWOZNtZbgG4h3ySLfRc=; b=zVuPwfyULs7O1TLSsJvhLkCty5fEwaZIgrSptvrunzW9XjPnehBuKGhoQbb/AIfnoa 7JhsdL5rPo/ocX5VzgubYMj0EyF9Wb6jOmTnLi8Ks0rIYKPuWKUOK5j7r0dS+r59SU6W vGqyL8iZnvotQgQe94U1ddEsX2o5X5XvnpFJzDxur1DUfITfmAGyT9Odoe2KnlZzCwX7 19hUWgTzPaWXZRICR3EJTChiA2i0BxX452RW6B1OWvPNtCgnJsTbFxHMZ87rwUm1FPGw 9PtZvecoXf7MjhyQuiaTp+4gKU5QoGIbJzRfpgU0ckMSKe6GWi+OSAPb0DCEnP1iE5hz sjRQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=j77jFmbV; spf=pass (google.com: domain of linux-wireless-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-wireless-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id ji14-20020a170907980e00b0073dd2e45989si6952516ejc.14.2022.08.29.08.42.03; Mon, 29 Aug 2022 08:42:30 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-wireless-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=j77jFmbV; spf=pass (google.com: domain of linux-wireless-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-wireless-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229587AbiH2Pfs (ORCPT + 64 others); Mon, 29 Aug 2022 11:35:48 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:35840 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229566AbiH2Pfr (ORCPT ); Mon, 29 Aug 2022 11:35:47 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [IPv6:2604:1380:4641:c500::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id E6E577B28E for ; Mon, 29 Aug 2022 08:35:45 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id 839086117B for ; Mon, 29 Aug 2022 15:35:45 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id E0E34C433D6; Mon, 29 Aug 2022 15:35:43 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1661787344; bh=ZWwqvIOS9mKhwMqfV535d6v5lPa4Z7WaRzovmpmsTIM=; h=From:To:Cc:Subject:In-Reply-To:References:Date:From; b=j77jFmbVcXy8QsAxHW060Wx/JU21N7UD8xeipEs78TYaxExRfYhxrmIkCODMNH9Nh iBTtl/Xz500VNGlfI/UwVrMjBTtXTbNc2psXglt+oL7i/uHp94u2+vps30xr7Pebnb 6oKsWSm8KpD0BM4C5SyHxw2Hf21AOr+dYonKE3e6c/Rcd7mk+EYm61N+a62Uuxc//8 Odb0huZdHLLG7TvAOm6dhN/+lEmzzz8PyM5EqpzqMh6D3N6m6Gk+XTM0A04H0lskjE W1JUxJ1Eh4UpkCF2le7GMaCM4ZJqBZBzJiD9jVRgTUhnKYDOo/ZUwFnJ1n4x3Mzt0Y KAYjut4Yhtd5w== From: Kalle Valo To: Nathan Chancellor Cc: Ping-Ke Shih , tony0620emma@gmail.com, linux-wireless@vger.kernel.org Subject: Re: [PATCH] wifi: rtw88: fix uninitialized use of primary channel index In-Reply-To: (Nathan Chancellor's message of "Wed, 24 Aug 2022 12:38:46 -0700") References: <20220815062004.22920-1-pkshih@realtek.com> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/26.1 (gnu/linux) Date: Mon, 29 Aug 2022 18:35:39 +0300 Message-ID: <87o7w3f4fo.fsf@kernel.org> MIME-Version: 1.0 Content-Type: text/plain X-Spam-Status: No, score=-7.1 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_HI, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-wireless@vger.kernel.org Nathan Chancellor writes: > On Mon, Aug 15, 2022 at 02:20:04PM +0800, Ping-Ke Shih wrote: > >> clang reports uninitialized use: >> >> >> drivers/net/wireless/realtek/rtw88/main.c:731:2: warning: variable >> 'primary_channel_idx' is used uninitialized whenever switch default is >> taken [-Wsometimes-uninitialized] >> default: >> ^~~~~~~ >> drivers/net/wireless/realtek/rtw88/main.c:754:39: note: uninitialized >> use occurs here >> hal->current_primary_channel_index = primary_channel_idx; >> ^~~~~~~~~~~~~~~~~~~ >> drivers/net/wireless/realtek/rtw88/main.c:687:24: note: initialize the >> variable 'primary_channel_idx' to silence this warning >> u8 primary_channel_idx; >> ^ >> = '\0' >> >> This situation could not happen, because possible channel bandwidth >> 20/40/80MHz are enumerated. >> >> Fixes: 341dd1f7de4c ("wifi: rtw88: add the update channel flow to support setting by parameters") >> Reported-by: kernel test robot >> Signed-off-by: Ping-Ke Shih > > Reviewed-by: Nathan Chancellor > > Can we get this into -next soon? This warning is breaking our builds due > to CONFIG_WERROR. Johannes applied it: https://git.kernel.org/netdev/net-next/c/4ffb4d25ef12 -- https://patchwork.kernel.org/project/linux-wireless/list/ https://wireless.wiki.kernel.org/en/developers/documentation/submittingpatches