From nobody Sun Oct 5 12:49:51 2025 Received: from mx0b-0031df01.pphosted.com (mx0b-0031df01.pphosted.com [205.220.180.131]) (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 215FC21FF25 for ; Mon, 4 Aug 2025 03:03:31 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=205.220.180.131 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1754276613; cv=none; b=NmEDkKAv0OgXSwCn8YJjGoJaL+zugL+gxeYMuj8UPvCklaaYC5yRqro4K38BncfgYg4o9AdiHPEszN+znwpnSGQ8osLxwFzNE8HFEnYAKBzRyviXP+j2lskYi/tesh/WWQcQl8dKDKzKmf4KBXXNU2Yn/oHerT7xUVIpX4x1gC8= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1754276613; c=relaxed/simple; bh=fulF+7++kKIq3FU51fxvSd6TZ2z/1EkUJ+ZdPG5wMqo=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=IxbiDBJmnmluBWdeJQWJLFhN9hUc/qee2ZTjMcKIYDFLzH3FCQPevvYj5ki9hNeAhAceXdtkDAlWE/YtKFDytNlnLizrZc6gZ7D+EPzJG1iUB6v2mshzySMmAAsdOKtRSnfV1OUlQfApnH8MoCAS009OiumfxonCVKZksEUkGkw= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=oss.qualcomm.com; spf=pass smtp.mailfrom=oss.qualcomm.com; dkim=pass (2048-bit key) header.d=qualcomm.com header.i=@qualcomm.com header.b=hZnr9AmE; arc=none smtp.client-ip=205.220.180.131 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=oss.qualcomm.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=oss.qualcomm.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=qualcomm.com header.i=@qualcomm.com header.b="hZnr9AmE" Received: from pps.filterd (m0279869.ppops.net [127.0.0.1]) by mx0a-0031df01.pphosted.com (8.18.1.2/8.18.1.2) with ESMTP id 573NnWDQ028438 for ; Mon, 4 Aug 2025 03:03:31 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=qualcomm.com; h= cc:content-transfer-encoding:content-type:date:from:in-reply-to :message-id:mime-version:references:subject:to; s=qcppdkim1; bh= Ws4K34M895QlwoqCvDCnlEt/m9zE1eKyV/9hDVzwdwA=; b=hZnr9AmEJIIm/hBU fzKLwCRWWUOWCxvwjZGHxP4X/PXt9H+WCJcns3ZyEVFyDslivoEArEgKWaDckw7n irbZYKBNY2Pi5IyQv3dtbAcKPwDrMboPTNdu1QHlZcCdrVdt56x9AqRyTB57VxAC oY76ggdZfMWVRB2aIFJ0MMeHLaevRBQSUadkTEUs+KXg/jLg7Txvik0RC66tt9tK obCodXGi0Uozsf/C11jLnnw78OJOTw44TLLnzczQYiLVws6+kCt9KqhNcsDYTHDn DNRyCMQUzJkuMBzPK3IflC+N2qF2ou+r5e1kaZs37rFMCidTE/U2wRLCCGkHwASk TL11hQ== Received: from mail-pg1-f200.google.com (mail-pg1-f200.google.com [209.85.215.200]) by mx0a-0031df01.pphosted.com (PPS) with ESMTPS id 4899pabcg2-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128 verify=NOT) for ; Mon, 04 Aug 2025 03:03:30 +0000 (GMT) Received: by mail-pg1-f200.google.com with SMTP id 41be03b00d2f7-b321087b1cdso4921830a12.2 for ; Sun, 03 Aug 2025 20:03:30 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1754276609; x=1754881409; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=Ws4K34M895QlwoqCvDCnlEt/m9zE1eKyV/9hDVzwdwA=; b=j6ADEH1NNveeyuNSxDvp2dCmu8VU5V4K47/e8LzEhCRCEwpTA6ziSo9QnL/YzpRx3D WV28X0RN/Mx4nCNTjCxxSrb5LNUAG3cQR9hOEPsHPH5fury+xImAM0/1PTifYghWjtYp 4QW5fNCktBA/UtOk5ZOV+1LHc9AXrcv7i1ZEKZ5Mz+LP1a7DuJqQKWeWFRvZHg7SHWCl eSEKz4Skg6nPZePbSlDgQZoi3W+ghEgcAJflN+OBCqXzFEgdk7dbIOdBUqug87jt0+oM hLwB2LJWG5MRifJ8QfaPSe84GsUZMXjwsy7TttHfoOORCrYouisWlxc4ntLLyt66rVTv yK7w== X-Forwarded-Encrypted: i=1; AJvYcCXG4x03b6z4L7ySx6UMKe3SuQ8ev5vVuRDouwK9KVPYsYMXhm3hualm701yVcVOfLcyfLn+fwfgwvPAIaI=@vger.kernel.org X-Gm-Message-State: AOJu0YwcIkvS/y2LsSaFrmOz/fIGipN3Ylm921A226qW7rEW7x1VOhCy gAtfHk+ygpi5drb0WDuxgHP5pSMbHRYm+xxPDaioeLHV+4iU8CI5/1wSLgilm0J0HC9e8cm8Kmo u2shlTI99WxYhhhYjGNE8JJH1+0ztBAoOpWnd3n/OY76wfZpw4TRBZCXdO23Ji4HWLmg= X-Gm-Gg: ASbGncvB0IU+mLOxmy3hA074+gO2zvJIFzgQukhw3+6qlBq0SgjbOVIKaMTtwNRSi2s rlx9+WqodvdGGBm8JVEdoMOm7p6BOaRC76aaNjgfsuvQ15pghw/DYuvsVsMJAbrSaXbYpLYZyNo dg98tSNltBtcmUmgl+g4f3yoD59AublkKynihOpDtXXBrV/asLeP5L+DUNSyKOJlxrCO1vJd8DW hrTg8IhQOwf8IdRTE6zOiqGBW1IAPimfqIS4q9+RbcLx6/ULoOx9bSQMAQuWdAF+rfY/YqUGEI2 98YI5ojBFhmCWaSVCgBv8jQ+NzE3eJqkqOogISAfohTQ9MEkr23ls6bRXDgsjzCmUn+QZ7raLmT 1KH+/RhsiA2+xenYRug== X-Received: by 2002:a05:6a20:1583:b0:234:8b24:108d with SMTP id adf61e73a8af0-23df9802825mr12965504637.22.1754276609367; Sun, 03 Aug 2025 20:03:29 -0700 (PDT) X-Google-Smtp-Source: AGHT+IFNOz3T56VRaGLUiNKjisoMK0eXMn1xWIfG3yzjpBzA6Ry//yUXJa0ThZsF7/BH5KTDJ3p0bw== X-Received: by 2002:a05:6a20:1583:b0:234:8b24:108d with SMTP id adf61e73a8af0-23df9802825mr12965460637.22.1754276608919; Sun, 03 Aug 2025 20:03:28 -0700 (PDT) Received: from [127.0.1.1] (tpe-colo-wan-fw-bordernet.qualcomm.com. [103.229.16.4]) by smtp.gmail.com with ESMTPSA id 98e67ed59e1d1-3207ebc0e79sm10489000a91.10.2025.08.03.20.03.26 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 03 Aug 2025 20:03:28 -0700 (PDT) From: Baochen Qiang Date: Mon, 04 Aug 2025 11:03:10 +0800 Subject: [PATCH ath-next 1/2] wifi: ath12k: initialize eirp_power before use 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: quoted-printable Message-Id: <20250804-ath12k-fix-smatch-warning-on-6g-vlp-v1-1-56f1e54152ab@oss.qualcomm.com> References: <20250804-ath12k-fix-smatch-warning-on-6g-vlp-v1-0-56f1e54152ab@oss.qualcomm.com> In-Reply-To: <20250804-ath12k-fix-smatch-warning-on-6g-vlp-v1-0-56f1e54152ab@oss.qualcomm.com> To: Jeff Johnson , Baochen Qiang , Vasanthakumar Thiagarajan Cc: Jeff Johnson , linux-wireless@vger.kernel.org, ath12k@lists.infradead.org, linux-kernel@vger.kernel.org, Baochen Qiang , kernel test robot , Dan Carpenter X-Mailer: b4 0.14.2 X-Proofpoint-Spam-Details-Enc: AW1haW4tMjUwODA0MDAxNCBTYWx0ZWRfXyf10VXZCYt6r B8CPI1aLa3uhtMmsL0vhvgR2MJOKwcXFVt2xwqa7/qTi/sXdXzYwoEvRDStxUBunzBHkBHNLVgt IPSVImtMMkXDnm8l1MoYIJWsdtcQnx7DJ6f+X7j9PkjasTuovDgx1i6oglRsoTxRhO0zzO2rhWF c4aQSRCn0EOZGORRJgCg9Aksi8lvfXt0SiWO/2nc9p3ZKwK0L4mwsEHnKtdmYoekh28qsQuFB1J LiBv+SSeC9LEokDVz3vH+SxriAQo2fcoAGWoVXDEeEGD+b7CcOEmOeb/lSEWlbleSEBtN3VWu1H vmtS1n980HNKWM3G/IUL3J8nqIQT3WvxNvMoXND6/b6B5xo6JdSGAv0fYJ7Dzh4zNA5mIbxiiBY kfjLrUq8e6Zxgi6BPsmxVgZ5TDs45mlGSGdcYAv3VztNY2r9t7K2199IduE2xFHzEvlQ9wF6 X-Proofpoint-GUID: ypmxpuy7z-zC9pglv7Y-feyf2ps5SdHy X-Authority-Analysis: v=2.4 cv=N88pF39B c=1 sm=1 tr=0 ts=68902302 cx=c_pps a=oF/VQ+ItUULfLr/lQ2/icg==:117 a=nuhDOHQX5FNHPW3J6Bj6AA==:17 a=IkcTkHD0fZMA:10 a=2OwXVqhp2XgA:10 a=VwQbUJbxAAAA:8 a=QyXUC8HyAAAA:8 a=KKAkSRfTAAAA:8 a=EUspDBNiAAAA:8 a=LZTIgfvDWzmdvsE2OGQA:9 a=QEXdDO2ut3YA:10 a=3WC7DwWrALyhR5TkjVHa:22 a=cvBusfyB2V15izCimMoJ:22 X-Proofpoint-ORIG-GUID: ypmxpuy7z-zC9pglv7Y-feyf2ps5SdHy X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.293,Aquarius:18.0.1099,Hydra:6.1.9,FMLib:17.12.80.40 definitions=2025-08-04_01,2025-08-01_01,2025-03-28_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 clxscore=1015 malwarescore=0 mlxlogscore=717 spamscore=0 phishscore=0 bulkscore=0 adultscore=0 suspectscore=0 impostorscore=0 mlxscore=0 lowpriorityscore=0 priorityscore=1501 classifier=spam authscore=0 authtc=n/a authcc= route=outbound adjust=0 reason=mlx scancount=1 engine=8.19.0-2505280000 definitions=main-2508040014 Currently, at the end of ath12k_mac_fill_reg_tpc_info(), the reg_tpc_info struct is populated, including the following: reg_tpc_info->is_psd_power =3D is_psd_power; reg_tpc_info->eirp_power =3D eirp_power; Kernel test robot complains on uninitialized symbol: drivers/net/wireless/ath/ath12k/mac.c:10069 ath12k_mac_fill_reg_tpc_info() error: uninitialized symbol 'eirp_power' This is because there are some code paths that never set eirp_power, so the assignment of reg_tpc_info->eirp_power can come from an uninitialized variable. Functionally this is OK since the eirp_power only has meaning when is_psd_power is true, and all code paths which set is_psd_power to true also set eirp_power. However, to keep the robot happy, always initialize eirp_power before use. Tested-on: WCN7850 hw2.0 PCI WLAN.HMT.1.1.c5-00284-QCAHMTSWPL_V1.0_V2.0_SIL= ICONZ-1 Fixes: aeda163bb0c7 ("wifi: ath12k: fill parameters for vdev set TPC power = WMI command") Reported-by: kernel test robot Reported-by: Dan Carpenter Closes: https://lore.kernel.org/r/202505180927.tbNWr3vE-lkp@intel.com/ Signed-off-by: Baochen Qiang Reviewed-by: Vasanthakumar Thiagarajan --- drivers/net/wireless/ath/ath12k/mac.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/net/wireless/ath/ath12k/mac.c b/drivers/net/wireless/a= th/ath12k/mac.c index bd1ec3b2c084169b841146931c54b6106f7006f6..8295480e8b1eeaa3e69cca823e6= 745733ade50e0 100644 --- a/drivers/net/wireless/ath/ath12k/mac.c +++ b/drivers/net/wireless/ath/ath12k/mac.c @@ -11228,8 +11228,8 @@ void ath12k_mac_fill_reg_tpc_info(struct ath12k *ar, struct ieee80211_channel *chan, *temp_chan; u8 pwr_lvl_idx, num_pwr_levels, pwr_reduction; bool is_psd_power =3D false, is_tpe_present =3D false; - s8 max_tx_power[ATH12K_NUM_PWR_LEVELS], - psd_power, tx_power, eirp_power; + s8 max_tx_power[ATH12K_NUM_PWR_LEVELS], psd_power, tx_power; + s8 eirp_power =3D 0; struct ath12k_vif *ahvif =3D arvif->ahvif; u16 start_freq, center_freq; u8 reg_6ghz_power_mode; --=20 2.25.1 From nobody Sun Oct 5 12:49:51 2025 Received: from mx0a-0031df01.pphosted.com (mx0a-0031df01.pphosted.com [205.220.168.131]) (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 4A520221DB6 for ; Mon, 4 Aug 2025 03:03:34 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=205.220.168.131 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1754276615; cv=none; b=Ex4T3tuBJnkMi/mSCRno4dmqYMdcE6Y5Wyqnh/+UiOEPzQDLZzd4NodgdBie3j7xAnXD28IQxdzQeXnmGT2ii6+I4HnvzV17SFuGvL92xmSSPVC9AVkSaxLl0R+nicwLKf2gq+84cXC3nkuXHlaHtF6oyma899zStzh2sneJRy4= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1754276615; c=relaxed/simple; bh=qjiG41H690nP9mB3xq6Z0RT6CrVbRj7u7Wnkix2PW9w=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=D9ccE3K1n/a1LXHN/qbv7p2uSI10ECmHccmf9hRaEvIPgNm5r+Y9XicX6/Q+90/yRVyJE5tPzBZZQWAp6PNGDrY0H9CCcjyua9FsxrjOdlY9uy6MnjPNMZ25wVdflBIdA1mYi4VmgPQP/ktyjBVNLzTTFw6NnwzAvtjq3qD0DV4= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=oss.qualcomm.com; spf=pass smtp.mailfrom=oss.qualcomm.com; dkim=pass (2048-bit key) header.d=qualcomm.com header.i=@qualcomm.com header.b=GxaFGpnF; arc=none smtp.client-ip=205.220.168.131 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=oss.qualcomm.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=oss.qualcomm.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=qualcomm.com header.i=@qualcomm.com header.b="GxaFGpnF" Received: from pps.filterd (m0279862.ppops.net [127.0.0.1]) by mx0a-0031df01.pphosted.com (8.18.1.2/8.18.1.2) with ESMTP id 5740sLN3019447 for ; Mon, 4 Aug 2025 03:03:33 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=qualcomm.com; h= cc:content-transfer-encoding:content-type:date:from:in-reply-to :message-id:mime-version:references:subject:to; s=qcppdkim1; bh= kugaIG05z6TB8lU/3AG4HIpKbvmdeKqgwRzdGMse6is=; b=GxaFGpnFpjSf+FAN ymIONS7/Jzrr90nV1sY4hOOnufocbaJ8B1oSxmaltbNtjlwAxBEWtsU4VWVI1T20 Eq0cF79novVLJ5G1qDojD7CseKI7Ow7+Pd6EoAWMfcGKwKFAKCKSwp0YNQGJh+hZ 8qVQLpC721k56v1+ISRVoBSljwWGVhkmh0F5EdzCJUpOyfi31kLISHgM4kf04r4A KZJHLcQMg+1Lx8kzjz1+dgKh9MZzMnp1ho5yig6PSJwWZ90WBiD8ive7ysqP1hpX KCnrJLmvna610rSoNCgrCoEEkm7j7mQXKNqmu3dOPI/3Lo9/+HZ2hcYPQbAwe4yA 4ScncQ== Received: from mail-pj1-f71.google.com (mail-pj1-f71.google.com [209.85.216.71]) by mx0a-0031df01.pphosted.com (PPS) with ESMTPS id 489bek382c-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128 verify=NOT) for ; Mon, 04 Aug 2025 03:03:33 +0000 (GMT) Received: by mail-pj1-f71.google.com with SMTP id 98e67ed59e1d1-31f5f70a07bso4452369a91.3 for ; Sun, 03 Aug 2025 20:03:33 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1754276612; x=1754881412; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=kugaIG05z6TB8lU/3AG4HIpKbvmdeKqgwRzdGMse6is=; b=MYMcYYSNivIoxMIJnvym/8ceR+6PwrCCIWbO2OgyuBDi3LnAhZ0dsi8h5Y3kekbJiL ZsozyWHEvY+euR2Hllgpugmou9pSAkO4P+vHBfJEWVRfj1pQQiLjM0pHwvSQdIS+i8X9 SZ+o7gt9AEAqfRq2dbnuuACLHGNf9Xo8U6B3Jjw53IjjkhJVFaG0TE5tt9nJ9y5R4O4d /3H4kjiH1OQAqK10gFjjm+kszxAHZKCXJd8rPRenmNRXPgCHyzkpmfJeHyH2GTLgJHbX wTbIwjYognlSLN2D0j+ZCi9ZDRt06ObpUHeuZAB1pEFNgld4cmzATUn+aVTViUFq3w0C SyyA== X-Forwarded-Encrypted: i=1; AJvYcCWeXDOTBJ/vVSZsQWoDg3r5namxC1QLk3oApnZusI9M/CHb10UYFuFmKgolD/rEIiTueFSu7riq+qqPEHI=@vger.kernel.org X-Gm-Message-State: AOJu0YxoZyxN+4etcdwFCvsZWvAqc5foEoa+nwqRpv69ZrEMK6J1uFbs ucgAlZgtQgU/oGnE5BgwvbLL9KEPI8qkN/f3/F3ZQln1GkRHAEeI/EYLaASV0jHnnJ6HpeVjE/t 0wq/XvH3qqU8e7BuXNCpSij+EpLMc3Ncb4A3xWKGOzSxb66+wBW7dH1387ESnyYll5cI= X-Gm-Gg: ASbGncvYH3T9Yg3eUV5axQDg/pir0W8i6yRak4k8HA2lSJlKhQvBTkErR8+13bbRlgE zgpRj5IsWHXRBvvXrsv1hSqlDIjkDRtz1eXnZMi5l7VSL7gYdNQ3FfNtpB+3M4ahzzNnoIEpxsC K/i6I27DerLGvLsYa/E3xLWvG0AYL01XMb+JQ9tAQf1ypDilSSXd0DL0vzvG8tMvWhMsuTlQHF0 yQEVShvz3B3puTFfyOC3/R9sMOVfTQY9uTdm4J4T4Wo1Owmy7u5g1Jtlpkl1JgrKZ9moh/F937p wLFxthUzJf9iMLCuCsz6WjK5bzXmHYlFCGozXUr6kY8KWPWlIgYbA+1l+i4qiy4B00902lCqsIo qlRaEcUI9sNfaLQZNUQ== X-Received: by 2002:a05:6a20:3ca3:b0:240:dc9:71cf with SMTP id adf61e73a8af0-2400dc976eemr2467491637.38.1754276612428; Sun, 03 Aug 2025 20:03:32 -0700 (PDT) X-Google-Smtp-Source: AGHT+IHQ8hpq8FcFPIUvqKGjKzFf0aD9aYMfmslygFO5EjJQ8zoEQ0LW0hIkkoaNDD9j549pSh6i1w== X-Received: by 2002:a05:6a20:3ca3:b0:240:dc9:71cf with SMTP id adf61e73a8af0-2400dc976eemr2467453637.38.1754276611989; Sun, 03 Aug 2025 20:03:31 -0700 (PDT) Received: from [127.0.1.1] (tpe-colo-wan-fw-bordernet.qualcomm.com. [103.229.16.4]) by smtp.gmail.com with ESMTPSA id 98e67ed59e1d1-3207ebc0e79sm10489000a91.10.2025.08.03.20.03.29 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 03 Aug 2025 20:03:31 -0700 (PDT) From: Baochen Qiang Date: Mon, 04 Aug 2025 11:03:11 +0800 Subject: [PATCH ath-next 2/2] wifi: ath12k: fix overflow warning on num_pwr_levels 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: quoted-printable Message-Id: <20250804-ath12k-fix-smatch-warning-on-6g-vlp-v1-2-56f1e54152ab@oss.qualcomm.com> References: <20250804-ath12k-fix-smatch-warning-on-6g-vlp-v1-0-56f1e54152ab@oss.qualcomm.com> In-Reply-To: <20250804-ath12k-fix-smatch-warning-on-6g-vlp-v1-0-56f1e54152ab@oss.qualcomm.com> To: Jeff Johnson , Baochen Qiang , Vasanthakumar Thiagarajan Cc: Jeff Johnson , linux-wireless@vger.kernel.org, ath12k@lists.infradead.org, linux-kernel@vger.kernel.org, Baochen Qiang , kernel test robot , Dan Carpenter X-Mailer: b4 0.14.2 X-Authority-Analysis: v=2.4 cv=M7tNKzws c=1 sm=1 tr=0 ts=68902305 cx=c_pps a=UNFcQwm+pnOIJct1K4W+Mw==:117 a=nuhDOHQX5FNHPW3J6Bj6AA==:17 a=IkcTkHD0fZMA:10 a=2OwXVqhp2XgA:10 a=VwQbUJbxAAAA:8 a=QyXUC8HyAAAA:8 a=COk6AnOGAAAA:8 a=KKAkSRfTAAAA:8 a=eeRMwnN673tcwiIEPYQA:9 a=QEXdDO2ut3YA:10 a=uKXjsCUrEbL0IQVhDsJ9:22 a=TjNXssC_j7lpFel5tvFf:22 a=cvBusfyB2V15izCimMoJ:22 X-Proofpoint-Spam-Details-Enc: AW1haW4tMjUwODA0MDAxNCBTYWx0ZWRfX/N5MK02wSN7C S/BHpOic15Hj+C1QX//9WeHgE0+FgHeRNvzqyx7hs4wyBYytC172TCpfclUWbZyejRKRN3yiLoN hNsYfqDd7DOaqKcE5vSibQ88wZjpkWaxMIaDy+H3HbPem9Q97f9zZRW//sspRBzCK5nB9Qy6DpE I3XKnLaJ2TAaCv/nWzt/5YOmJazdOH4QkPtpv52f8KZ1ozNRZ4d8GIWMOQGrpPksRxKOrShf17T Cl0UcJOdk3AS6ZRKko3MZP/yDhclH7fW2mlWE3xqTUvixBXexXtrLtyvrmQuo9YX42PD2SD5i4i BbHzAKiwB6JDy06m54PLETMHYeulmS0GtaZ/da2D7XIJ2Rm4F42G8ovxNrtyGrQI5VIqcgdNgZu zrsikjc2wIDEAIRPjxi8HOexzDAwUD1twovfCbrbTcnTJBHlYSNRxVsRfowrX7yd9RkWu00H X-Proofpoint-ORIG-GUID: k_Xz9hkRvl3d6ZYikk0UkzmjWbiZHSsY X-Proofpoint-GUID: k_Xz9hkRvl3d6ZYikk0UkzmjWbiZHSsY X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.293,Aquarius:18.0.1099,Hydra:6.1.9,FMLib:17.12.80.40 definitions=2025-08-04_01,2025-08-01_01,2025-03-28_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 impostorscore=0 lowpriorityscore=0 priorityscore=1501 malwarescore=0 clxscore=1015 mlxlogscore=869 mlxscore=0 bulkscore=0 spamscore=0 suspectscore=0 phishscore=0 adultscore=0 classifier=spam authscore=0 authtc=n/a authcc= route=outbound adjust=0 reason=mlx scancount=1 engine=8.19.0-2505280000 definitions=main-2508040014 From: Baochen Qiang In ath12k_mac_parse_tx_pwr_env(), for the non-PSD case num_pwr_levels is limited by ATH12K_NUM_PWR_LEVELS which is 16: if (tpc_info->num_pwr_levels > ATH12K_NUM_PWR_LEVELS) tpc_info->num_pwr_levels =3D ATH12K_NUM_PWR_LEVELS; Then it is used to iterate entries in local_non_psd->power[] and reg_non_psd->power[]: for (i =3D 0; i < tpc_info->num_pwr_levels; i++) { tpc_info->tpe[i] =3D min(local_non_psd->power[i], reg_non_psd->power[i]) / 2; Since the two array are of size 5, Smatch warns: drivers/net/wireless/ath/ath12k/mac.c:9812 ath12k_mac_parse_tx_pwr_env() error: buffer overflow 'local_non_psd->power'= 5 <=3D 15 drivers/net/wireless/ath/ath12k/mac.c:9812 ath12k_mac_parse_tx_pwr_env() error: buffer overflow 'reg_non_psd->power' 5= <=3D 15 This is a false positive as there is already implicit limitation: tpc_info->num_pwr_levels =3D max(local_non_psd->count, reg_non_psd->count); meaning it won't exceed 5. However, to make robot happy, add explicit limit there. Also add the same to the PSD case, although no warning due to ATH12K_NUM_PWR_LEVELS equals IEEE80211_TPE_PSD_ENTRIES_320MHZ. Tested-on: WCN7850 hw2.0 PCI WLAN.HMT.1.1.c5-00284-QCAHMTSWPL_V1.0_V2.0_SIL= ICONZ-1 Fixes: cccbb9d0dd6a ("wifi: ath12k: add parse of transmit power envelope el= ement") Reported-by: kernel test robot Reported-by: Dan Carpenter Closes: https://lore.kernel.org/r/202505180703.Kr9OfQRP-lkp@intel.com/ Signed-off-by: Baochen Qiang Reviewed-by: Vasanthakumar Thiagarajan --- drivers/net/wireless/ath/ath12k/mac.c | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/drivers/net/wireless/ath/ath12k/mac.c b/drivers/net/wireless/a= th/ath12k/mac.c index 8295480e8b1eeaa3e69cca823e6745733ade50e0..57c81ba988ad3c7c3037286c6c0= 93cef4c4f8116 100644 --- a/drivers/net/wireless/ath/ath12k/mac.c +++ b/drivers/net/wireless/ath/ath12k/mac.c @@ -11435,8 +11435,10 @@ static void ath12k_mac_parse_tx_pwr_env(struct ath= 12k *ar, =20 tpc_info->num_pwr_levels =3D max(local_psd->count, reg_psd->count); - if (tpc_info->num_pwr_levels > ATH12K_NUM_PWR_LEVELS) - tpc_info->num_pwr_levels =3D ATH12K_NUM_PWR_LEVELS; + tpc_info->num_pwr_levels =3D + min3(tpc_info->num_pwr_levels, + IEEE80211_TPE_PSD_ENTRIES_320MHZ, + ATH12K_NUM_PWR_LEVELS); =20 for (i =3D 0; i < tpc_info->num_pwr_levels; i++) { tpc_info->tpe[i] =3D min(local_psd->power[i], @@ -11451,8 +11453,10 @@ static void ath12k_mac_parse_tx_pwr_env(struct ath= 12k *ar, =20 tpc_info->num_pwr_levels =3D max(local_non_psd->count, reg_non_psd->count); - if (tpc_info->num_pwr_levels > ATH12K_NUM_PWR_LEVELS) - tpc_info->num_pwr_levels =3D ATH12K_NUM_PWR_LEVELS; + tpc_info->num_pwr_levels =3D + min3(tpc_info->num_pwr_levels, + IEEE80211_TPE_EIRP_ENTRIES_320MHZ, + ATH12K_NUM_PWR_LEVELS); =20 for (i =3D 0; i < tpc_info->num_pwr_levels; i++) { tpc_info->tpe[i] =3D min(local_non_psd->power[i], --=20 2.25.1