Received: by 2002:a05:7208:9594:b0:7e:5202:c8b4 with SMTP id gs20csp2542307rbb; Wed, 28 Feb 2024 05:20:03 -0800 (PST) X-Forwarded-Encrypted: i=3; AJvYcCV1antUjerYXpoZT3ndqh98B+s/IJB6TB7uFQ/gKFyox5Qq/DuSRXodorURSKRaDuDdVfLlINBJeyU+kvmJEIviIz7e6k0IHbIVxmFYAw== X-Google-Smtp-Source: AGHT+IEcxRvV8IE3MeBcJvHqNWWuvRb6egIPOhPtIgpvpmizCXkUaX+DDMgGFlForTolTh+JrJ9p X-Received: by 2002:a0c:f103:0:b0:68f:a78f:bf1d with SMTP id i3-20020a0cf103000000b0068fa78fbf1dmr4765603qvl.39.1709126402971; Wed, 28 Feb 2024 05:20:02 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1709126402; cv=pass; d=google.com; s=arc-20160816; b=xLQNpejkbRvZmUueNP2BqjwqMMN65XinMXG2gFGOwrG1PWNnrVHMYIIgmyWr4BQjmt 8Q1liTPOELXUfgALlWUVA71IRY4wZIskAVIFvlrux/sde0iMQnydkyZM6JGKC9NaHkvA lJQM73goc6CZJHU1mCezvyIHbCo0osqOq3ZNHIrvZJy8GfxMPDEezx4L7u4Pa5K1xTWR R48bPLPyxKQS4xpDeTcMlWVoEgSMWbmGQIFwxcJt6W33QT90/TGrYvmLFTG6wwmcAdVj x73oEX5X8QTIbFpIyuOXiK8rzv0rE0ICuByDXiLC8/xK5Z7FRYMrE2GrjHNXmVqP5Jyj XBCw== 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:message-id:date:subject:cc:to :from:dkim-signature; bh=BKd6AYY/qyTKWtkQvGPqgumRbX+7Xt8jtiNMbeWZso8=; fh=sCBUYb6zmUY06GV8PKwsBXGEHQzjMLEMQvd5CMPm8wg=; b=dmWDz/zMzc2qoknQXYjsmiKUP8gLsPF5WJQXSKRZ5oljHPGM28P47yMX5kyLadttmi /ZLYXm8LIpH/CAhhYKe/GII29NJhsz9lKzlII92XaQAKOc4vFlxFMU58qojkKtypMvcz wzGtQcb9UiFTqYUIEZ/setonv1JqEC0+rKfFSRUAOY2HAdOdN2vfHNCmq/QvdF1cvtwy VVE8KVzVnsecPartvbMAAoRunOmCYig37CjTD+0bKGy5K3pO4SsCyNJCdMGDDdzJfRIn ZIqMewinXi6mDL6IOtWoJPKXwBHI/sbZlDUwUN9NFKcji0n84fnLK6NwXb1KT2sok5Kn pw3g==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@yandex.ru header.s=mail header.b=Zh6vIBIw; arc=pass (i=1 spf=pass spfdomain=yandex.ru dkim=pass dkdomain=yandex.ru dmarc=pass fromdomain=yandex.ru); spf=pass (google.com: domain of linux-wireless+bounces-4189-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-wireless+bounces-4189-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=yandex.ru Return-Path: Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [2604:1380:45d1:ec00::1]) by mx.google.com with ESMTPS id a11-20020ad45c4b000000b0068efd7caaabsi9631707qva.105.2024.02.28.05.20.02 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 28 Feb 2024 05:20:02 -0800 (PST) Received-SPF: pass (google.com: domain of linux-wireless+bounces-4189-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=@yandex.ru header.s=mail header.b=Zh6vIBIw; arc=pass (i=1 spf=pass spfdomain=yandex.ru dkim=pass dkdomain=yandex.ru dmarc=pass fromdomain=yandex.ru); spf=pass (google.com: domain of linux-wireless+bounces-4189-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-wireless+bounces-4189-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=yandex.ru 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 7FD801C2578E for ; Wed, 28 Feb 2024 13:20:02 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 150183BBEE; Wed, 28 Feb 2024 13:20:00 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=yandex.ru header.i=@yandex.ru header.b="Zh6vIBIw" X-Original-To: linux-wireless@vger.kernel.org Received: from forward201c.mail.yandex.net (forward201c.mail.yandex.net [178.154.239.220]) (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 E75C6149DE2 for ; Wed, 28 Feb 2024 13:19:55 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=178.154.239.220 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1709126400; cv=none; b=Q3vE8bqzpztbYUUUDhuRY4pL+xO3XxpnIJChQbiEelMrEp7hBOrwXQG6o1aS3KR+xUZPWktW9ymmf3ihjp4st5zftrOhbvub5RErHiKKAp1wX98TY+pllyYWhApoohI+mUhxCpGKGHOBsmsi1x0lyzcizM1dvO0wNCaEtaZdmXg= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1709126400; c=relaxed/simple; bh=uLiJjCAL4NrQGVPz9RxXPebySmm7585inFNecGAQGpI=; h=From:To:Cc:Subject:Date:Message-ID:MIME-Version; b=anO8aVyS9+LLC2JcGAKxzEehbJZOuL7b83aL4qdNL3r3YCi/m+OnMqsuC/xgv4BTKMXHzchxw/12elWyiqO4u2LC0+DmnZIzURxZ3PdGJqpSvjDJG3gVXru+oiKwNzQZseN9/dUkDRwjuqRjOQsL1DQdQep9wl8AAP/6OXfDfG8= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=yandex.ru; spf=pass smtp.mailfrom=yandex.ru; dkim=pass (1024-bit key) header.d=yandex.ru header.i=@yandex.ru header.b=Zh6vIBIw; arc=none smtp.client-ip=178.154.239.220 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=yandex.ru Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=yandex.ru Received: from forward102c.mail.yandex.net (forward102c.mail.yandex.net [IPv6:2a02:6b8:c03:500:1:45:d181:d102]) by forward201c.mail.yandex.net (Yandex) with ESMTPS id 0C01865FF2 for ; Wed, 28 Feb 2024 16:14:39 +0300 (MSK) Received: from mail-nwsmtp-smtp-production-main-44.sas.yp-c.yandex.net (mail-nwsmtp-smtp-production-main-44.sas.yp-c.yandex.net [IPv6:2a02:6b8:c14:440b:0:640:fa3a:0]) by forward102c.mail.yandex.net (Yandex) with ESMTPS id 4158D60A9D; Wed, 28 Feb 2024 16:14:31 +0300 (MSK) Received: by mail-nwsmtp-smtp-production-main-44.sas.yp-c.yandex.net (smtp/Yandex) with ESMTPSA id TEZITt9GcOs0-3Rndb7bc; Wed, 28 Feb 2024 16:14:30 +0300 X-Yandex-Fwd: 1 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yandex.ru; s=mail; t=1709126070; bh=BKd6AYY/qyTKWtkQvGPqgumRbX+7Xt8jtiNMbeWZso8=; h=Message-ID:Date:Cc:Subject:To:From; b=Zh6vIBIwD3HKf9QXIrjO+8dxj1pcdIn9cM52S56TGPK+j8f2ohMsArG9Hrg2bvWM+ QRbCArehx8ZXhYeVYtG1rVpfTsHGfRFUcNKIMdDz3R6naDJkDfJvJebX3XuMiYhw7z 7OCVP8Ft/flXLxBlFn30noMdVXAfTbzMZ+JVgdVA= Authentication-Results: mail-nwsmtp-smtp-production-main-44.sas.yp-c.yandex.net; dkim=pass header.i=@yandex.ru From: Dmitry Antipov To: Baochen Qiang Cc: Jeff Johnson , Kalle Valo , ath11k@lists.infradead.org, linux-wireless@vger.kernel.org, lvc-project@linuxtesting.org, Dmitry Antipov Subject: [PATCH] wifi: ath11k: fix few -Wmaybe-uninitialized warnings Date: Wed, 28 Feb 2024 16:14:06 +0300 Message-ID: <20240228131406.165786-1-dmantipov@yandex.ru> X-Mailer: git-send-email 2.43.2 Precedence: bulk X-Mailing-List: linux-wireless@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit When compiling with gcc version 14.0.1 20240226 (experimental) and W=12, I've noticed the following warnings: drivers/net/wireless/ath/ath11k/mac.c: In function 'ath11k_mac_op_remain_on_channel': drivers/net/wireless/ath/ath11k/mac.c:9230:12: warning: 'ret' may be used uninitialized [-Wmaybe-uninitialized] 9230 | if (ret) drivers/net/wireless/ath/ath11k/qmi.c: In function 'ath11k_qmi_load_file_target_mem': drivers/net/wireless/ath/ath11k/qmi.c:2401:16: warning: 'ret' may be used uninitialized [-Wmaybe-uninitialized] 2401 | return ret; drivers/net/wireless/ath/ath11k/qmi.c: In function 'ath11k_qmi_load_bdf_qmi': drivers/net/wireless/ath/ath11k/qmi.c:2494:17: warning: 'fw_entry' may be used uninitialized [-Wmaybe-uninitialized] 2494 | release_firmware(fw_entry); And a bunch of them traced to uninitialized fields of the same variable, e.g.: drivers/net/wireless/ath/ath11k/spectral.c: In function 'ath11k_spectral_process_data': drivers/net/wireless/ath/ath11k/spectral.c:700:47: warning: 'summ_rpt.meta.freq1' may be used uninitialized [-Wmaybe-uninitialized] 700 | struct ath11k_spectral_summary_report summ_rpt; Fix all of the above by using 0 and NULL initializers where appropriate. Note there are few more (less obvious) -Wmaybe-uninitialized warnings still remains, but they're hardly possible to fix without running on a physical hardware. Compile tested oly. Also noticed by Linux Verification Center (linuxtesting.org) with SVACE. Signed-off-by: Dmitry Antipov --- drivers/net/wireless/ath/ath11k/mac.c | 2 +- drivers/net/wireless/ath/ath11k/qmi.c | 4 ++-- drivers/net/wireless/ath/ath11k/spectral.c | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/drivers/net/wireless/ath/ath11k/mac.c b/drivers/net/wireless/ath/ath11k/mac.c index a6a37d67a50a..b89bc7ceaaa7 100644 --- a/drivers/net/wireless/ath/ath11k/mac.c +++ b/drivers/net/wireless/ath/ath11k/mac.c @@ -9201,7 +9201,7 @@ static int ath11k_mac_op_remain_on_channel(struct ieee80211_hw *hw, struct ath11k *ar = hw->priv; struct ath11k_vif *arvif = ath11k_vif_to_arvif(vif); struct scan_req_params *arg; - int ret; + int ret = 0; u32 scan_time_msec; mutex_lock(&ar->conf_mutex); diff --git a/drivers/net/wireless/ath/ath11k/qmi.c b/drivers/net/wireless/ath/ath11k/qmi.c index 5006f81f779b..4477f652e068 100644 --- a/drivers/net/wireless/ath/ath11k/qmi.c +++ b/drivers/net/wireless/ath/ath11k/qmi.c @@ -2293,7 +2293,7 @@ static int ath11k_qmi_load_file_target_mem(struct ath11k_base *ab, struct qmi_txn txn; const u8 *temp = data; void __iomem *bdf_addr = NULL; - int ret; + int ret = 0; u32 remaining = len; req = kzalloc(sizeof(*req), GFP_KERNEL); @@ -2406,7 +2406,7 @@ static int ath11k_qmi_load_bdf_qmi(struct ath11k_base *ab, { struct device *dev = ab->dev; char filename[ATH11K_QMI_MAX_BDF_FILE_NAME_SIZE]; - const struct firmware *fw_entry; + const struct firmware *fw_entry = NULL; struct ath11k_board_data bd; u32 fw_size, file_type; int ret = 0, bdf_type; diff --git a/drivers/net/wireless/ath/ath11k/spectral.c b/drivers/net/wireless/ath/ath11k/spectral.c index 79e091134515..4c826b539404 100644 --- a/drivers/net/wireless/ath/ath11k/spectral.c +++ b/drivers/net/wireless/ath/ath11k/spectral.c @@ -697,7 +697,7 @@ static int ath11k_spectral_process_data(struct ath11k *ar, struct ath11k_base *ab = ar->ab; struct spectral_tlv *tlv; struct spectral_summary_fft_report *summary = NULL; - struct ath11k_spectral_summary_report summ_rpt; + struct ath11k_spectral_summary_report summ_rpt = { 0 }; struct fft_sample_ath11k *fft_sample = NULL; u8 *data; u32 data_len, i; -- 2.43.2