Received: by 2002:a05:7412:2a8c:b0:e2:908c:2ebd with SMTP id u12csp1421962rdh; Mon, 25 Sep 2023 12:15:06 -0700 (PDT) X-Google-Smtp-Source: AGHT+IH8Z1ks9OXZeBiZyWvn2Yjj53/BhWaFN+n4q0v2+XESvAqvqkuzqKXd/kII3rstWqT+jTN4 X-Received: by 2002:a17:903:110d:b0:1c5:cd01:d846 with SMTP id n13-20020a170903110d00b001c5cd01d846mr9688303plh.3.1695669305731; Mon, 25 Sep 2023 12:15:05 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1695669305; cv=none; d=google.com; s=arc-20160816; b=UVIROlutwTipEiESHMwPADSZT4nKXQsVsbGRZBrop7eW4pmzaWKbWlRBO4AMoh532+ XQ1y+wtN4juEcNSySe64IhvMozvM3xFdrLWPo74tOFRhDjffAeWV/4kZl68GhsSajaVB HtDoXgMNMtf0cCPKWU1l9t2sjdBzYpul7p+ue/HMhPciNatnG6qI1dyR5Sb6XzbyCuFF zb4/Hp/REIWraG2CPqGaYyUB4x6mLuLaByhYJdwiD+vlmYqeG7YykHOR5NP8YVvPR4nH aesAIW6Q9g3uBmZUr7FaoxX2wd7fifm/EZ49E0NmI2216gwkvZNR63oo/MNpkppdITrj L/sQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:in-reply-to:from :references:cc:to:content-language:subject:user-agent:mime-version :date:message-id:dkim-signature; bh=Jr6k6269NdMSe/wZnFEItt6PcgwyvmPFe7xKMihrEfM=; fh=HkPcTa2cf6jnyRSZWijr/a2y69llEHTgGWGTxfEYokY=; b=JFhlfBDXbL1qJLIh0mwxYbxpOSTBDnk8yT68Xp7Al4kH5X6V8J5vG7tTsDTcUgteCE V4WZIEtOgUCyacN2LqvuYPkaUzu6YRaTR2QyKCTZ/fzKMMnzvzJsTedTRLYBs6rro+K1 ufT/Pt7Jj6MIjhn+XI+64vr054kM8tP/IgCUEcazfzP7D3da4n4BlBYGWO/8ome8mg08 4YqyJ8aNiMRcJ8zxS1KRcKDkXQfvj9WVtPyECJjaHfxdU5CSpgGgD+unqLflJgq7/3l3 UqbjLTjVYn7v0LLQW3xXG23fdikooDqFZZmhCWyeR1O9qYfXXb6jHqwavFVP5O6YnWu2 LZnA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@quicinc.com header.s=qcppdkim1 header.b=b9IULkbG; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:3 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=quicinc.com Return-Path: Received: from lipwig.vger.email (lipwig.vger.email. [2620:137:e000::3:3]) by mx.google.com with ESMTPS id kz15-20020a170902f9cf00b001bb2d95f2a7si9914921plb.267.2023.09.25.12.15.05 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 25 Sep 2023 12:15:05 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:3 as permitted sender) client-ip=2620:137:e000::3:3; Authentication-Results: mx.google.com; dkim=pass header.i=@quicinc.com header.s=qcppdkim1 header.b=b9IULkbG; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:3 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=quicinc.com Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by lipwig.vger.email (Postfix) with ESMTP id A04568047D69; Mon, 25 Sep 2023 11:46:18 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at lipwig.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233132AbjIYSqR (ORCPT + 99 others); Mon, 25 Sep 2023 14:46:17 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:50040 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232126AbjIYSqQ (ORCPT ); Mon, 25 Sep 2023 14:46:16 -0400 Received: from mx0b-0031df01.pphosted.com (mx0b-0031df01.pphosted.com [205.220.180.131]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 15A2495; Mon, 25 Sep 2023 11:46:08 -0700 (PDT) Received: from pps.filterd (m0279868.ppops.net [127.0.0.1]) by mx0a-0031df01.pphosted.com (8.17.1.19/8.17.1.19) with ESMTP id 38PFMQWE000787; Mon, 25 Sep 2023 18:46:05 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=quicinc.com; h=message-id : date : mime-version : subject : to : cc : references : from : in-reply-to : content-type : content-transfer-encoding; s=qcppdkim1; bh=Jr6k6269NdMSe/wZnFEItt6PcgwyvmPFe7xKMihrEfM=; b=b9IULkbGGYs+XbTcJvQXoyMclRcNaqox2nu83sx6YP7NkM9FvEKAkouX6z/tQA8WZJac TZYgOzA0cpvBnjinYAtlfK8rcZdieppDNQ3ttOhxRNoo9J3N+gktvv8eYseAS+eYtyly GtTPoUOh1n4Uux2rqdp0XVVWwMreMU8eqCOKmrzPN7TEO9xTDtpvdcJ2kZAiekSWNlT+ a2eSrKeAd2H9/CrpnxdUeCswg9XWGAcw6rXKKAZZpfjTMmZRJyO3B2MvRFK0ddpJM41Q Vhfv3JOvESmgvZT4azp9bjEvQAwm7O3rqbfqPQ061K4h7e01Z0RbGRfgY6a9djtomPyA 1g== Received: from nalasppmta05.qualcomm.com (Global_NAT1.qualcomm.com [129.46.96.20]) by mx0a-0031df01.pphosted.com (PPS) with ESMTPS id 3tb6tt1d60-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Mon, 25 Sep 2023 18:46:04 +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 38PIk3Ss031334 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Mon, 25 Sep 2023 18:46:03 GMT Received: from [10.48.244.213] (10.49.16.6) 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.1118.36; Mon, 25 Sep 2023 11:46:03 -0700 Message-ID: Date: Mon, 25 Sep 2023 11:46:02 -0700 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH wireless 1/2] ath: dfs_pattern_detector: Fix a memory initialization issue Content-Language: en-US To: Christophe JAILLET , Kalle Valo CC: , , "Kalle Valo" , References: From: Jeff Johnson In-Reply-To: Content-Type: text/plain; charset="UTF-8"; format=flowed Content-Transfer-Encoding: 7bit X-Originating-IP: [10.49.16.6] X-ClientProxiedBy: nalasex01c.na.qualcomm.com (10.47.97.35) 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: uKXFCC1BcjHEwDCRqscCPID6gIha-rr1 X-Proofpoint-ORIG-GUID: uKXFCC1BcjHEwDCRqscCPID6gIha-rr1 X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.267,Aquarius:18.0.980,Hydra:6.0.619,FMLib:17.11.176.26 definitions=2023-09-25_15,2023-09-25_01,2023-05-22_02 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 impostorscore=0 malwarescore=0 mlxlogscore=999 priorityscore=1501 adultscore=0 lowpriorityscore=0 spamscore=0 mlxscore=0 phishscore=0 bulkscore=0 suspectscore=0 clxscore=1011 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2309180000 definitions=main-2309250145 X-Spam-Status: No, score=-0.9 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lipwig.vger.email Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (lipwig.vger.email [0.0.0.0]); Mon, 25 Sep 2023 11:46:18 -0700 (PDT) On 9/23/2023 11:57 PM, Christophe JAILLET wrote: > If an error occurs and channel_detector_exit() is called, it relies on > entries of the 'detectors' array to be NULL. > Otherwise, it may access to un-initialized memory. > > Fix it and initialize the memory, as what was done before the commit in > Fixes. > > Fixes: a063b650ce5d ("ath: dfs_pattern_detector: Avoid open coded arithmetic in memory allocation") > Signed-off-by: Christophe JAILLET > --- > Patch #1/2 is a fix, for for wireless. > Patch #2/2 is for wireless-next I guess, but depnds on #1 > > Not sure if we can mix different target in the same serie. Let me know. > > BTW, sorry for messing up things with a063b650ce5d :( > --- > drivers/net/wireless/ath/dfs_pattern_detector.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/drivers/net/wireless/ath/dfs_pattern_detector.c b/drivers/net/wireless/ath/dfs_pattern_detector.c > index 27f4d74a41c8..2788a1b06c17 100644 > --- a/drivers/net/wireless/ath/dfs_pattern_detector.c > +++ b/drivers/net/wireless/ath/dfs_pattern_detector.c > @@ -206,7 +206,7 @@ channel_detector_create(struct dfs_pattern_detector *dpd, u16 freq) > > INIT_LIST_HEAD(&cd->head); > cd->freq = freq; > - cd->detectors = kmalloc_array(dpd->num_radar_types, > + cd->detectors = kcalloc(dpd->num_radar_types, > sizeof(*cd->detectors), GFP_ATOMIC); nit: align descendant on ( > if (cd->detectors == NULL) > goto fail;