From patchwork Wed Dec 21 10:55:26 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Thiraviyam Mariyappan X-Patchwork-Id: 635946 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 21506C4167B for ; Wed, 21 Dec 2022 10:56:35 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234468AbiLUK4d (ORCPT ); Wed, 21 Dec 2022 05:56:33 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:33470 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234660AbiLUK4P (ORCPT ); Wed, 21 Dec 2022 05:56:15 -0500 Received: from mx0a-0031df01.pphosted.com (mx0a-0031df01.pphosted.com [205.220.168.131]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 01FC920375 for ; Wed, 21 Dec 2022 02:56:15 -0800 (PST) Received: from pps.filterd (m0279862.ppops.net [127.0.0.1]) by mx0a-0031df01.pphosted.com (8.17.1.19/8.17.1.19) with ESMTP id 2BL9piL0018756; Wed, 21 Dec 2022 10:56:12 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=quicinc.com; h=from : to : cc : subject : date : message-id : in-reply-to : references : mime-version : content-type; s=qcppdkim1; bh=B0WEfYUu/OhdP110qIuduHHYNIqjaV3osrD/8Dm8GHk=; b=c5ML7zbdQv8dxZ6yBcFcTnA8hsIQ/sqhWnv269gB7ExMqDUJUcpzGby+IxHKOL5rQoS/ +MN2W+Lkn3uvnSlxS9Fachb75HqfQ5kgLEDOyA360ZL5HO+DNA6Le8GeOgbN+M6x0nNS WG58nUYtNKdBcB8bhyRoMk8l/f3H0NY50K/esnp/mNwMK6pE8kygw9n13JJMxMApEWYl Jol8I+aqXqxhyP63QMhMnDHmTmo3fvisMmDSxpkfhjE8X2DjjRTXCR2JYAUF4DVWGOnz bAc8s9N6DOz6BgVvk6NhZdr34b8rbikhY90lWdUtKE07ej/3bTAvqAEXlwdYa+4YhZBf bQ== Received: from nalasppmta01.qualcomm.com (Global_NAT1.qualcomm.com [129.46.96.20]) by mx0a-0031df01.pphosted.com (PPS) with ESMTPS id 3mkmvt9dnb-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Wed, 21 Dec 2022 10:56:11 +0000 Received: from nalasex01a.na.qualcomm.com (nalasex01a.na.qualcomm.com [10.47.209.196]) by NALASPPMTA01.qualcomm.com (8.17.1.5/8.17.1.5) with ESMTPS id 2BLAuBMF016776 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Wed, 21 Dec 2022 10:56:11 GMT Received: from tmariyap-linux.qualcomm.com (10.80.80.8) by nalasex01a.na.qualcomm.com (10.47.209.196) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.986.36; Wed, 21 Dec 2022 02:56:09 -0800 From: Thiraviyam Mariyappan To: CC: , Thiraviyam Mariyappan Subject: [PATCH 1/4] wifi: ath12k: Fix uninitilized variable clang warnings Date: Wed, 21 Dec 2022 16:25:26 +0530 Message-ID: <20221221105529.19345-2-quic_tmariyap@quicinc.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20221221105529.19345-1-quic_tmariyap@quicinc.com> References: <20221221105529.19345-1-quic_tmariyap@quicinc.com> MIME-Version: 1.0 X-Originating-IP: [10.80.80.8] X-ClientProxiedBy: nasanex01b.na.qualcomm.com (10.46.141.250) To nalasex01a.na.qualcomm.com (10.47.209.196) X-QCInternal: smtphost X-Proofpoint-Virus-Version: vendor=nai engine=6200 definitions=5800 signatures=585085 X-Proofpoint-ORIG-GUID: WRuCY8tKNVmzeO7Ixq_aypzevkd3qZ1G X-Proofpoint-GUID: WRuCY8tKNVmzeO7Ixq_aypzevkd3qZ1G X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.205,Aquarius:18.0.923,Hydra:6.0.545,FMLib:17.11.122.1 definitions=2022-12-21_05,2022-12-21_01,2022-06-22_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 mlxscore=0 bulkscore=0 malwarescore=0 adultscore=0 suspectscore=0 priorityscore=1501 lowpriorityscore=0 clxscore=1015 impostorscore=0 mlxlogscore=999 phishscore=0 spamscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2212070000 definitions=main-2212210088 Precedence: bulk List-ID: X-Mailing-List: linux-wireless@vger.kernel.org Fix uninitilized variable warnings spotted during clang compilation. Warnings: drivers/net/wireless/ath/ath12k/mac.c:1076:8: warning: variable 'ret' is used uninitialized whenever 'if' condition is true [-Wsometimes-uninitialized] drivers/net/wireless/ath/ath12k/dbring.c:272:7: warning: variable 'ring' is used uninitialized whenever switch case is taken [-Wsometimes-uninitialized] drivers/net/wireless/ath/ath12k/dp_rx.c:2690:34: warning: variable 'i' is uninitialized when used here [-Wuninitialized] Tested-on: QCN9274 hw2.0 PCI WLAN.WBE.1.0-03171-QCAHKSWPL_SILICONZ-1 Reported-by: kernel test robot Signed-off-by: Thiraviyam Mariyappan --- drivers/net/wireless/ath/ath12k/dbring.c | 2 +- drivers/net/wireless/ath/ath12k/dp_rx.c | 3 +-- drivers/net/wireless/ath/ath12k/mac.c | 4 ++-- 3 files changed, 4 insertions(+), 5 deletions(-) diff --git a/drivers/net/wireless/ath/ath12k/dbring.c b/drivers/net/wireless/ath/ath12k/dbring.c index 9aa2631be1a8..8fbf868e6f7e 100644 --- a/drivers/net/wireless/ath/ath12k/dbring.c +++ b/drivers/net/wireless/ath/ath12k/dbring.c @@ -230,7 +230,7 @@ int ath12k_dbring_get_cap(struct ath12k_base *ab, int ath12k_dbring_buffer_release_event(struct ath12k_base *ab, struct ath12k_dbring_buf_release_event *ev) { - struct ath12k_dbring *ring; + struct ath12k_dbring *ring = NULL; struct hal_srng *srng; struct ath12k *ar; struct ath12k_dbring_element *buff; diff --git a/drivers/net/wireless/ath/ath12k/dp_rx.c b/drivers/net/wireless/ath/ath12k/dp_rx.c index d6835d13f7ec..83a43ad48c51 100644 --- a/drivers/net/wireless/ath/ath12k/dp_rx.c +++ b/drivers/net/wireless/ath/ath12k/dp_rx.c @@ -2582,7 +2582,6 @@ int ath12k_dp_rx_process(struct ath12k_base *ab, int ring_id, struct sk_buff *msdu; bool done = false; int mac_id; - int i; u64 desc_va; __skb_queue_head_init(&msdu_list); @@ -2687,7 +2686,7 @@ int ath12k_dp_rx_process(struct ath12k_base *ab, int ring_id, goto exit; /* TODO: Move to implicit BM? */ - ath12k_dp_rx_bufs_replenish(ab, i, rx_ring, num_buffs_reaped, + ath12k_dp_rx_bufs_replenish(ab, 0, rx_ring, num_buffs_reaped, ab->hw_params->hal_params->rx_buf_rbm, true); ath12k_dp_rx_process_received_packets(ab, napi, &msdu_list, diff --git a/drivers/net/wireless/ath/ath12k/mac.c b/drivers/net/wireless/ath/ath12k/mac.c index ac6548c087ba..bf7e5b6977b2 100644 --- a/drivers/net/wireless/ath/ath12k/mac.c +++ b/drivers/net/wireless/ath/ath12k/mac.c @@ -1057,7 +1057,7 @@ static int ath12k_mac_op_config(struct ieee80211_hw *hw, u32 changed) { struct ath12k *ar = hw->priv; struct ieee80211_conf *conf = &hw->conf; - int ret; + int ret = 0; mutex_lock(&ar->conf_mutex); @@ -1089,7 +1089,7 @@ static int ath12k_mac_op_config(struct ieee80211_hw *hw, u32 changed) err_mon_del: ath12k_mac_monitor_vdev_delete(ar); mutex_unlock(&ar->conf_mutex); - return 0; + return ret; } static int ath12k_mac_setup_bcn_tmpl(struct ath12k_vif *arvif) From patchwork Wed Dec 21 10:55:27 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Thiraviyam Mariyappan X-Patchwork-Id: 636296 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 071CBC4332F for ; Wed, 21 Dec 2022 10:56:41 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230430AbiLUK4h (ORCPT ); Wed, 21 Dec 2022 05:56:37 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:33894 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234345AbiLUK4T (ORCPT ); Wed, 21 Dec 2022 05:56:19 -0500 Received: from mx0a-0031df01.pphosted.com (mx0a-0031df01.pphosted.com [205.220.168.131]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 2B5321DE for ; Wed, 21 Dec 2022 02:56:19 -0800 (PST) Received: from pps.filterd (m0279867.ppops.net [127.0.0.1]) by mx0a-0031df01.pphosted.com (8.17.1.19/8.17.1.19) with ESMTP id 2BL9nxXg021669; Wed, 21 Dec 2022 10:56:17 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=quicinc.com; h=from : to : cc : subject : date : message-id : in-reply-to : references : mime-version : content-type; s=qcppdkim1; bh=fjIrs5eCGAufFm7GzMSc4H56gYrOm65WIWG+sLqF64s=; b=hW1deZTkAN35r0+mpYt89+afpeaJpyQy+AksX/MkQ5fduJtwxvXcqPW+Y8Af0frBPgkj ZViAGf1lmspmZoOPxaq8Knt0yQEPpi7pewEGmYsah17jqjV8VCNtefzj4HnJYPu2je1b 9bCtKCqZxcH7X4bYNjiU519HG4w3RHds3HR9MCVL1X7/J0ZzETC950syXvuuO3mi7z9J mO4aD7jonsZa9ccubFKAYUomNEofbGYkdkPQ+WydUCjRwwfnnKO0frQ5kdOBbaXm97EX 5bP2DjpvzRWlOMoxzKGT51KnvMO591pyZTefnlOx5giYK+rmayEy3Kaw4mJgrd4zZngr 1Q== Received: from nalasppmta01.qualcomm.com (Global_NAT1.qualcomm.com [129.46.96.20]) by mx0a-0031df01.pphosted.com (PPS) with ESMTPS id 3mk39tbqvk-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Wed, 21 Dec 2022 10:56:16 +0000 Received: from nalasex01a.na.qualcomm.com (nalasex01a.na.qualcomm.com [10.47.209.196]) by NALASPPMTA01.qualcomm.com (8.17.1.5/8.17.1.5) with ESMTPS id 2BLAuFqC016817 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Wed, 21 Dec 2022 10:56:16 GMT Received: from tmariyap-linux.qualcomm.com (10.80.80.8) by nalasex01a.na.qualcomm.com (10.47.209.196) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.986.36; Wed, 21 Dec 2022 02:56:14 -0800 From: Thiraviyam Mariyappan To: CC: , Thiraviyam Mariyappan Subject: [PATCH 2/4] wifi: ath12k: hal_rx: Use memset_startat() for clearing queue descriptors Date: Wed, 21 Dec 2022 16:25:27 +0530 Message-ID: <20221221105529.19345-3-quic_tmariyap@quicinc.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20221221105529.19345-1-quic_tmariyap@quicinc.com> References: <20221221105529.19345-1-quic_tmariyap@quicinc.com> MIME-Version: 1.0 X-Originating-IP: [10.80.80.8] X-ClientProxiedBy: nasanex01b.na.qualcomm.com (10.46.141.250) To nalasex01a.na.qualcomm.com (10.47.209.196) X-QCInternal: smtphost X-Proofpoint-Virus-Version: vendor=nai engine=6200 definitions=5800 signatures=585085 X-Proofpoint-ORIG-GUID: hy2Sy6_8Wh26py4ik7gLTPsVrTZk37c7 X-Proofpoint-GUID: hy2Sy6_8Wh26py4ik7gLTPsVrTZk37c7 X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.205,Aquarius:18.0.923,Hydra:6.0.545,FMLib:17.11.122.1 definitions=2022-12-21_05,2022-12-21_01,2022-06-22_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 suspectscore=0 mlxlogscore=710 spamscore=0 clxscore=1015 adultscore=0 priorityscore=1501 impostorscore=0 phishscore=0 lowpriorityscore=0 malwarescore=0 mlxscore=0 bulkscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2212070000 definitions=main-2212210088 Precedence: bulk List-ID: X-Mailing-List: linux-wireless@vger.kernel.org In preparation for FORTIFY_SOURCE performing compile-time and run-time field bounds checking for memset(), avoid intentionally writing across neighboring fields. Use memset_startat() so memset() doesn't get confused about writing beyond the destination member that is intended to be the starting point of zeroing through the end of the struct and fixes the below clang warning. Warning: include/linux/fortify-string.h:314:4: warning: call to '__write_overflow_field' declared with 'warning' attribute: detected write beyond size of field (1st parameter); maybe use struct_group()? [-Wattribute-warning] Tested-on: QCN9274 hw2.0 PCI WLAN.WBE.1.0-03171-QCAHKSWPL_SILICONZ-1 Reported-by: kernel test robot Signed-off-by: Thiraviyam Mariyappan --- drivers/net/wireless/ath/ath12k/hal_rx.c | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/drivers/net/wireless/ath/ath12k/hal_rx.c b/drivers/net/wireless/ath/ath12k/hal_rx.c index d47befb83e38..ee61a6462fdc 100644 --- a/drivers/net/wireless/ath/ath12k/hal_rx.c +++ b/drivers/net/wireless/ath/ath12k/hal_rx.c @@ -30,8 +30,7 @@ static int ath12k_hal_reo_cmd_queue_stats(struct hal_tlv_64_hdr *tlv, u32_encode_bits(sizeof(*desc), HAL_TLV_HDR_LEN); desc = (struct hal_reo_get_queue_stats *)tlv->value; - memset(&desc->queue_addr_lo, 0, - (sizeof(*desc) - sizeof(struct hal_reo_cmd_hdr))); + memset_startat(desc, 0, queue_addr_lo); desc->cmd.info0 &= ~cpu_to_le32(HAL_REO_CMD_HDR_INFO0_STATUS_REQUIRED); if (cmd->flag & HAL_REO_CMD_FLG_NEED_STATUS) @@ -64,8 +63,7 @@ static int ath12k_hal_reo_cmd_flush_cache(struct ath12k_hal *hal, u32_encode_bits(sizeof(*desc), HAL_TLV_HDR_LEN); desc = (struct hal_reo_flush_cache *)tlv->value; - memset(&desc->cache_addr_lo, 0, - (sizeof(*desc) - sizeof(struct hal_reo_cmd_hdr))); + memset_startat(desc, 0, cache_addr_lo); desc->cmd.info0 &= ~cpu_to_le32(HAL_REO_CMD_HDR_INFO0_STATUS_REQUIRED); if (cmd->flag & HAL_REO_CMD_FLG_NEED_STATUS) @@ -103,8 +101,7 @@ static int ath12k_hal_reo_cmd_update_rx_queue(struct hal_tlv_64_hdr *tlv, u32_encode_bits(sizeof(*desc), HAL_TLV_HDR_LEN); desc = (struct hal_reo_update_rx_queue *)tlv->value; - memset(&desc->queue_addr_lo, 0, - (sizeof(*desc) - sizeof(struct hal_reo_cmd_hdr))); + memset_startat(desc, 0, queue_addr_lo); desc->cmd.info0 &= ~cpu_to_le32(HAL_REO_CMD_HDR_INFO0_STATUS_REQUIRED); if (cmd->flag & HAL_REO_CMD_FLG_NEED_STATUS) From patchwork Wed Dec 21 10:55:28 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Thiraviyam Mariyappan X-Patchwork-Id: 635945 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id C60FCC41535 for ; Wed, 21 Dec 2022 10:56:42 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234470AbiLUK4l (ORCPT ); Wed, 21 Dec 2022 05:56:41 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:33264 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231245AbiLUK4X (ORCPT ); Wed, 21 Dec 2022 05:56:23 -0500 Received: from mx0a-0031df01.pphosted.com (mx0a-0031df01.pphosted.com [205.220.168.131]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id D4C0F3BA for ; Wed, 21 Dec 2022 02:56:22 -0800 (PST) Received: from pps.filterd (m0279866.ppops.net [127.0.0.1]) by mx0a-0031df01.pphosted.com (8.17.1.19/8.17.1.19) with ESMTP id 2BL5tnlK015096; Wed, 21 Dec 2022 10:56:21 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=quicinc.com; h=from : to : cc : subject : date : message-id : in-reply-to : references : mime-version : content-type; s=qcppdkim1; bh=cODI84NCLVHKyJSIgg8Tva1vufH5mWjNRTg4PBlHe6k=; b=k2e8TppGii2w0NppBbsC+MtYhS3lORJZkVLGKRSDkj0M9g7gY+Ys90ydhs4rSX2a65oS L2fC4Dwg3bpnG2m2CUYBu5JLNqGEt7WNl0sXwTb2tG6ZKc5SUcxoZCej4o65LysM/2mY /X69T2n83KNu5GxQJk0entbWBrBwhn8/UVov45s2zOceti01X/FBwh6IjAjZCFiqmjnQ cxPHyJo0snZU1//XPRv8asyRo3F+aC/NFqhEirCLm38i66jfccl5M3A33ZExarBiPgKP U1HFTApWJv2BoY3ojuxksHDN9CogS/+ZsAPlfazfKVwlD7tK4yD3PZnTUxb+//QS/Rbl Jw== Received: from nalasppmta05.qualcomm.com (Global_NAT1.qualcomm.com [129.46.96.20]) by mx0a-0031df01.pphosted.com (PPS) with ESMTPS id 3mkkxcshgu-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Wed, 21 Dec 2022 10:56:21 +0000 Received: from nalasex01a.na.qualcomm.com (nalasex01a.na.qualcomm.com [10.47.209.196]) by NALASPPMTA05.qualcomm.com (8.17.1.5/8.17.1.5) with ESMTPS id 2BLAuKgJ030123 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Wed, 21 Dec 2022 10:56:20 GMT Received: from tmariyap-linux.qualcomm.com (10.80.80.8) by nalasex01a.na.qualcomm.com (10.47.209.196) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.986.36; Wed, 21 Dec 2022 02:56:18 -0800 From: Thiraviyam Mariyappan To: CC: , Thiraviyam Mariyappan Subject: [PATCH 3/4] wifi: ath12k: dp_mon: Fix out of bounds clang warning Date: Wed, 21 Dec 2022 16:25:28 +0530 Message-ID: <20221221105529.19345-4-quic_tmariyap@quicinc.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20221221105529.19345-1-quic_tmariyap@quicinc.com> References: <20221221105529.19345-1-quic_tmariyap@quicinc.com> MIME-Version: 1.0 X-Originating-IP: [10.80.80.8] X-ClientProxiedBy: nasanex01b.na.qualcomm.com (10.46.141.250) To nalasex01a.na.qualcomm.com (10.47.209.196) X-QCInternal: smtphost X-Proofpoint-Virus-Version: vendor=nai engine=6200 definitions=5800 signatures=585085 X-Proofpoint-GUID: gkTBx6vFKtUfJSLUJiEzCwImPs9IZ8p1 X-Proofpoint-ORIG-GUID: gkTBx6vFKtUfJSLUJiEzCwImPs9IZ8p1 X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.205,Aquarius:18.0.923,Hydra:6.0.545,FMLib:17.11.122.1 definitions=2022-12-21_05,2022-12-21_01,2022-06-22_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 phishscore=0 bulkscore=0 clxscore=1015 priorityscore=1501 spamscore=0 adultscore=0 impostorscore=0 malwarescore=0 suspectscore=0 mlxscore=0 mlxlogscore=697 lowpriorityscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2212070000 definitions=main-2212210088 Precedence: bulk List-ID: X-Mailing-List: linux-wireless@vger.kernel.org Fix below out-of-bounds access warning while processing ppdu end user stats. The size of info array is 6 but storing 7 values, Fix this with increasing info array size to 7. Warning: drivers/net/wireless/ath/ath12k/dp_mon.c:623:3: warning: array index 6 is past the end of the array (that has type 'u32[6]' (aka 'unsigned int[6]')) [-Warray-bounds] Tested-on: QCN9274 hw2.0 PCI WLAN.WBE.1.0-03171-QCAHKSWPL_SILICONZ-1 Reported-by: kernel test robot Signed-off-by: Thiraviyam Mariyappan --- drivers/net/wireless/ath/ath12k/dp_mon.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/net/wireless/ath/ath12k/dp_mon.c b/drivers/net/wireless/ath/ath12k/dp_mon.c index 7e9759807c88..f6f2e83f8f8e 100644 --- a/drivers/net/wireless/ath/ath12k/dp_mon.c +++ b/drivers/net/wireless/ath/ath12k/dp_mon.c @@ -588,7 +588,7 @@ ath12k_dp_mon_rx_parse_status_tlv(struct ath12k_base *ab, u32 tlv_tag, u8 *tlv_data, u32 userid) { struct hal_rx_mon_ppdu_info *ppdu_info = &pmon->mon_ppdu_info; - u32 info[6]; + u32 info[7]; switch (tlv_tag) { case HAL_RX_PPDU_START: { From patchwork Wed Dec 21 10:55:29 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Thiraviyam Mariyappan X-Patchwork-Id: 636295 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id E1BCCC4332F for ; Wed, 21 Dec 2022 10:56:43 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231245AbiLUK4m (ORCPT ); Wed, 21 Dec 2022 05:56:42 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:33830 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234073AbiLUK4a (ORCPT ); Wed, 21 Dec 2022 05:56:30 -0500 Received: from mx0b-0031df01.pphosted.com (mx0b-0031df01.pphosted.com [205.220.180.131]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id CC617B71 for ; Wed, 21 Dec 2022 02:56:29 -0800 (PST) Received: from pps.filterd (m0279869.ppops.net [127.0.0.1]) by mx0a-0031df01.pphosted.com (8.17.1.19/8.17.1.19) with ESMTP id 2BL63lUe016104; Wed, 21 Dec 2022 10:56:26 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=quicinc.com; h=from : to : cc : subject : date : message-id : in-reply-to : references : mime-version : content-type; s=qcppdkim1; bh=+V7QXULflFlXLKTcvUar3DCET4UdTZ1AzZxVI39YnNM=; b=LvpB8F1Q1M29rIUu2Nt2YPzlcQ2TiGVZyDaMpPOccmqDOHwu7MmS3swPqzX6k/LiwOZ7 PeLTXjNRzhi1ib8fJItT3N4Y3JPpZqkS6zNben9EeHv4nOoiDzBd6x3PLwvxeogUY1iA sdOBsWrpOlZ15+Z+65Bn5yVMlszUbsczo+6XNVI8Hf+ZUaiy2FW8MvpH4fgGw0BnuvUw w0HlTvGqbtZeelDhsSwxN8hgUx25X0K7rCSppll+u1KOMlXx59+WqWb3pDEjokfuwCPK KY13GdqBg3RES5iurMGsgvKoSldi/Rk4Dd9AMHuKktDZ+84SmSCEJ1ymoozxNUGHAIwv 4g== Received: from nalasppmta04.qualcomm.com (Global_NAT1.qualcomm.com [129.46.96.20]) by mx0a-0031df01.pphosted.com (PPS) with ESMTPS id 3mk83xu57v-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Wed, 21 Dec 2022 10:56:26 +0000 Received: from nalasex01a.na.qualcomm.com (nalasex01a.na.qualcomm.com [10.47.209.196]) by NALASPPMTA04.qualcomm.com (8.17.1.5/8.17.1.5) with ESMTPS id 2BLAuPQL007894 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Wed, 21 Dec 2022 10:56:25 GMT Received: from tmariyap-linux.qualcomm.com (10.80.80.8) by nalasex01a.na.qualcomm.com (10.47.209.196) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.986.36; Wed, 21 Dec 2022 02:56:23 -0800 From: Thiraviyam Mariyappan To: CC: , Thiraviyam Mariyappan Subject: [PATCH 4/4] wifi: ath12k: dp_mon: Fix uninitialized warning related to the pktlog Date: Wed, 21 Dec 2022 16:25:29 +0530 Message-ID: <20221221105529.19345-5-quic_tmariyap@quicinc.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20221221105529.19345-1-quic_tmariyap@quicinc.com> References: <20221221105529.19345-1-quic_tmariyap@quicinc.com> MIME-Version: 1.0 X-Originating-IP: [10.80.80.8] X-ClientProxiedBy: nasanex01b.na.qualcomm.com (10.46.141.250) To nalasex01a.na.qualcomm.com (10.47.209.196) X-QCInternal: smtphost X-Proofpoint-Virus-Version: vendor=nai engine=6200 definitions=5800 signatures=585085 X-Proofpoint-ORIG-GUID: OFls_oW5TAQYcxOPBLbgZOlo-iVZUvIq X-Proofpoint-GUID: OFls_oW5TAQYcxOPBLbgZOlo-iVZUvIq X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.205,Aquarius:18.0.923,Hydra:6.0.545,FMLib:17.11.122.1 definitions=2022-12-21_05,2022-12-21_01,2022-06-22_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 mlxscore=0 mlxlogscore=736 clxscore=1015 bulkscore=0 phishscore=0 impostorscore=0 lowpriorityscore=0 adultscore=0 priorityscore=1501 spamscore=0 suspectscore=0 malwarescore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2212070000 definitions=main-2212210088 Precedence: bulk List-ID: X-Mailing-List: linux-wireless@vger.kernel.org Uninitialized warning in the code changes related to pktlog, which is not completely supported in ath12k driver yet. Hence, remove the changes to avoid the warning. Warning: drivers/net/wireless/ath/ath12k/dp_mon.c:2138:18: warning: variable 'rx_buf_sz' is uninitialized when used here [-Wuninitialized] Tested-on: QCN9274 hw2.0 PCI WLAN.WBE.1.0-03171-QCAHKSWPL_SILICONZ-1 Reported-by: kernel test robot Signed-off-by: Thiraviyam Mariyappan --- drivers/net/wireless/ath/ath12k/dp_mon.c | 6 ------ 1 file changed, 6 deletions(-) diff --git a/drivers/net/wireless/ath/ath12k/dp_mon.c b/drivers/net/wireless/ath/ath12k/dp_mon.c index f6f2e83f8f8e..a214797c96a2 100644 --- a/drivers/net/wireless/ath/ath12k/dp_mon.c +++ b/drivers/net/wireless/ath/ath12k/dp_mon.c @@ -2076,8 +2076,6 @@ int ath12k_dp_mon_srng_process(struct ath12k *ar, int mac_id, int *budget, bool end_of_ppdu; struct hal_rx_mon_ppdu_info *ppdu_info; struct ath12k_peer *peer = NULL; - u32 rx_buf_sz; - u16 log_type = 0; ppdu_info = &pmon->mon_ppdu_info; memset(ppdu_info, 0, sizeof(*ppdu_info)); @@ -2133,10 +2131,6 @@ int ath12k_dp_mon_srng_process(struct ath12k *ar, int mac_id, int *budget, for (i = 0; i < dest_idx; i++) { skb = pmon->dest_skb_q[i]; - if (log_type) - trace_ath12k_htt_rxdesc(ar, skb->data, - log_type, rx_buf_sz); - if (monitor_mode == ATH12K_DP_RX_MONITOR_MODE) ath12k_dp_mon_rx_parse_mon_status(ar, pmon, mac_id, skb, napi);