Received: by 2002:a05:6a10:413:0:0:0:0 with SMTP id 19csp3589940pxp; Tue, 8 Mar 2022 18:14:03 -0800 (PST) X-Google-Smtp-Source: ABdhPJwbuWv8lsRW4dk2dVVL0+BbV9zLCF2Gk+f9nN2C2Yuouc181RC+6iw9mh6UhGiOsYKnvni/ X-Received: by 2002:a62:1a53:0:b0:4f7:69d:9731 with SMTP id a80-20020a621a53000000b004f7069d9731mr12543544pfa.31.1646792042952; Tue, 08 Mar 2022 18:14:02 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1646792042; cv=none; d=google.com; s=arc-20160816; b=HX8beF+SxLekpD5FeHLar8kO+Dn7q6JbM24247bX5nGFQw8wGoPsCSnwJYM160qwtO xdOs7Olftc4cCZ0XLNFGfI4WoB2X61mj6QZXV1eDYymnj6U2ffF1cCFc67+27mdA3/ob aeXCnjiB1zNlC5DWp46Ib7x7a7evKWOV3lK+IjD1QC6aR4v1LWUMqGF67Zi72bpp4kjl BUZA11umS6K+fjCmyQNg23b5BHXO++/g2tjo562o6V9N6uZ4VFO/zLqvqQeuxOAeQ3/N cxyqewUNQjnD9sQt+QUz1xUu470lJVz3SkWUSjTX3jO0KhXiuxEPN6rSdNZKqIATg87o yjjQ== 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:to:content-language:subject:user-agent:mime-version:date :message-id:dkim-signature; bh=keyAJb6A5NPJJZZCWIJLthBI4AdiJa40DZ7S3GIHMrU=; b=vNK/XflrCgXc5vPqYueF9up0+fNFMdfbwODrzt+NVC3OPwlndur5kCkVps58mRwUpG yqF1y2TyQ/zyL0lT5cXjubbCoCLDstKZGeUZrO2nF3a9WLFYJxGfa/WYvHiVI4Cd0y7+ VQb75UiPHrBR7KnsZbc+3S166qkwUvEsDMRHXRBvf9lNATLvTaug8vOw0tjQAiGWauMK UC3Mw54BA+ecr01muTXwN1NlaKtPL3Dfv5KGmxy73FWKH5AxWVuSZPimg/yo+IHRlqS0 VtKoAzErbGMCtRnOv5S1J80GbdFWLeZqbx4WDEUmBdECImk2AU4BlHttYtS/dt+kdk3d 9c2w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@quicinc.com header.s=qcdkim header.b=LZkhgbgl; spf=pass (google.com: domain of linux-wireless-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) smtp.mailfrom=linux-wireless-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=quicinc.com Return-Path: Received: from lindbergh.monkeyblade.net (lindbergh.monkeyblade.net. [2620:137:e000::1:18]) by mx.google.com with ESMTPS id z4-20020a656644000000b0037392422940si532342pgv.746.2022.03.08.18.14.02 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 08 Mar 2022 18:14:02 -0800 (PST) Received-SPF: pass (google.com: domain of linux-wireless-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) client-ip=2620:137:e000::1:18; Authentication-Results: mx.google.com; dkim=pass header.i=@quicinc.com header.s=qcdkim header.b=LZkhgbgl; spf=pass (google.com: domain of linux-wireless-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) smtp.mailfrom=linux-wireless-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=quicinc.com Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 2083814893B; Tue, 8 Mar 2022 17:05:58 -0800 (PST) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229873AbiCIBGk (ORCPT + 70 others); Tue, 8 Mar 2022 20:06:40 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:51078 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229763AbiCIBGI (ORCPT ); Tue, 8 Mar 2022 20:06:08 -0500 Received: from alexa-out-sd-01.qualcomm.com (alexa-out-sd-01.qualcomm.com [199.106.114.38]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id A30FE145E18; Tue, 8 Mar 2022 16:45:22 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=quicinc.com; i=@quicinc.com; q=dns/txt; s=qcdkim; t=1646786722; x=1678322722; h=message-id:date:mime-version:subject:to:references:from: in-reply-to:content-transfer-encoding; bh=keyAJb6A5NPJJZZCWIJLthBI4AdiJa40DZ7S3GIHMrU=; b=LZkhgbglOnIIedL+zx7HWB8iGr38V54updzBUpfDUDWk0tL2ryH8YhJo VjZi1Eq3n9vhxdzXIufTmAEA5mbaRIqimlpBYrjNgpbLxNw6Aw2znMYcF Msty4iozTX/XVi+sc7dXfIgdStfsbn+6pctjv3/QPhVW1Ds+VaXf2DhMT o=; Received: from unknown (HELO ironmsg05-sd.qualcomm.com) ([10.53.140.145]) by alexa-out-sd-01.qualcomm.com with ESMTP; 08 Mar 2022 16:05:12 -0800 X-QCInternal: smtphost Received: from nasanex01c.na.qualcomm.com ([10.47.97.222]) by ironmsg05-sd.qualcomm.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 08 Mar 2022 16:05:11 -0800 Received: from nalasex01a.na.qualcomm.com (10.47.209.196) by nasanex01c.na.qualcomm.com (10.47.97.222) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.986.15; Tue, 8 Mar 2022 16:05:11 -0800 Received: from [10.111.182.121] (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.986.15; Tue, 8 Mar 2022 16:05:10 -0800 Message-ID: Date: Tue, 8 Mar 2022 16:05:09 -0800 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:91.0) Gecko/20100101 Thunderbird/91.5.1 Subject: Re: [PATCH] ath10k: Fix error handling in ath10k_setup_msa_resources Content-Language: en-US To: Miaoqian Lin , Kalle Valo , "David S. Miller" , Jakub Kicinski , "Rakesh Pillai" , , , , References: <20220308070238.19295-1-linmq006@gmail.com> From: Jeff Johnson In-Reply-To: <20220308070238.19295-1-linmq006@gmail.com> 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-Spam-Status: No, score=-2.0 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,NICE_REPLY_A,RDNS_NONE,SPF_HELO_NONE, T_SCC_BODY_TEXT_LINE autolearn=no 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 On 3/7/2022 11:02 PM, Miaoqian Lin wrote: > The device_node pointer is returned by of_parse_phandle() with refcount Kalle, can you fix this nit when you apply? remove extra space after () > incremented. We should use of_node_put() on it when done. > > This function only calls of_node_put() in the regular path. > And it will cause refcount leak in error path. > > Fixes: 727fec790ead ("ath10k: Setup the msa resources before qmi init") > Signed-off-by: Miaoqian Lin > --- > drivers/net/wireless/ath/ath10k/snoc.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/drivers/net/wireless/ath/ath10k/snoc.c b/drivers/net/wireless/ath/ath10k/snoc.c > index 9513ab696fff..f79dd9a71690 100644 > --- a/drivers/net/wireless/ath/ath10k/snoc.c > +++ b/drivers/net/wireless/ath/ath10k/snoc.c > @@ -1556,11 +1556,11 @@ static int ath10k_setup_msa_resources(struct ath10k *ar, u32 msa_size) > node = of_parse_phandle(dev->of_node, "memory-region", 0); > if (node) { > ret = of_address_to_resource(node, 0, &r); > + of_node_put(node); > if (ret) { > dev_err(dev, "failed to resolve msa fixed region\n"); > return ret; > } > - of_node_put(node); > > ar->msa.paddr = r.start; > ar->msa.mem_size = resource_size(&r); Reviewed-by: Jeff Johnson