Received: by 2002:a05:6a10:2726:0:0:0:0 with SMTP id ib38csp848562pxb; Wed, 6 Apr 2022 01:50:13 -0700 (PDT) X-Google-Smtp-Source: ABdhPJywtH1tnhjc+YoSj9pmWhLFOphEPxqh/C+IpuHb2O7cUNdBwQRfW86JQVyqLtFP2aD2RqfP X-Received: by 2002:a05:6a00:21c2:b0:4fe:81f:46c7 with SMTP id t2-20020a056a0021c200b004fe081f46c7mr7722488pfj.5.1649235013246; Wed, 06 Apr 2022 01:50:13 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1649235013; cv=none; d=google.com; s=arc-20160816; b=LMOy06IjUtJFkXt+1vFgHwCaWZ5sTmca1dQWurlCjLZF+an2cy0oXjQx+tizvNASIa E9pnxc2i63c5qz97RTSKom7bI8EUzABfU6QYA4oVCI37FS8PgwfbLhoMe0tqHaUZedo7 bz9sf0JZ5bWdCOHE9fAj9o9v0/oK6+iWKcpkGFnxFAlZfxkhnKEzMtvU7DsEV2oiTOIm ZxrnB6PefNMcXHLk8MJCsG4IbHef+kHUBfjyQONuZtFjMO/6CPJ1Fg3+7tmnl7rvsD9n LLEBaCGSszlii46ccJnK23oz2Mf6PVt/JAVKzpKwxLLyXNESC/KO5UQex6AnNd9poywu dyjQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=jwe3uCeJxxkNpIoWPsyUdw29uH5pNzPWwfnxaUYRkmk=; b=RWwZTjkERgryg2UfqiO0fwJ0A36lB3fHsWNZPSm6GlP/gxzlwPNhuQ70VptCyL7K8s AK78K2fCzBKHKrMaUbk1PBpFSixKXZoPwjRx9I07nMlPbVhc0rKa3IOnhuNNNvwznmGp 4RB1R6c28+c6iELUm5i/AMTgb++Cjmx8EUEC52JxXTUPhj1d0z0GGY061fMnliyUXc4k aiXnnW1IZ4sODBtjBtXDUwSc7601ntruMa4K5nGNDFlSltdHeb83zPL7rCSS59W81RsG dVTSdJhvTlB5Ee7IMw4PRhVhD6kKdDeA+Cq4295aClOnLHiYlHKR96vkprW9N2VfUB9+ vh6g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=1lVs05GR; spf=softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Return-Path: Received: from lindbergh.monkeyblade.net (lindbergh.monkeyblade.net. [23.128.96.19]) by mx.google.com with ESMTPS id c18-20020a170902d49200b00156bddf0f3csi6132498plg.53.2022.04.06.01.50.12 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 06 Apr 2022 01:50:13 -0700 (PDT) Received-SPF: softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 as permitted sender) client-ip=23.128.96.19; Authentication-Results: mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=1lVs05GR; spf=softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 59033368EDC; Wed, 6 Apr 2022 01:34:47 -0700 (PDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S241763AbiDFB2D (ORCPT + 99 others); Tue, 5 Apr 2022 21:28:03 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:44280 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1349207AbiDEJt0 (ORCPT ); Tue, 5 Apr 2022 05:49:26 -0400 Received: from ams.source.kernel.org (ams.source.kernel.org [145.40.68.75]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id A98432253D; Tue, 5 Apr 2022 02:42:43 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ams.source.kernel.org (Postfix) with ESMTPS id 53261B818F3; Tue, 5 Apr 2022 09:42:42 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id A883DC385A1; Tue, 5 Apr 2022 09:42:40 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1649151761; bh=u8PxMLCYo4rYp2EXONipyGluuU3I5q0QkRQTH2Ha+LM=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=1lVs05GRpXcBBO+qOUANVF2UhKmBtiCBn2AXDgUhP54FkG3ujQuYiD4dJ92wg93J0 b75qqRt3+Q0gO1/AM9lC4UTtIfoZxfd23IkfWFSf+rgBLs7a4kvedkABYRqiCxwKKz OvzwYE4h5yGOdMs+ugNuGr/V6VT/BuL2kJVv/41I= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Miaoqian Lin , Jeff Johnson , Kalle Valo , Sasha Levin Subject: [PATCH 5.15 531/913] ath10k: Fix error handling in ath10k_setup_msa_resources Date: Tue, 5 Apr 2022 09:26:33 +0200 Message-Id: <20220405070355.766997510@linuxfoundation.org> X-Mailer: git-send-email 2.35.1 In-Reply-To: <20220405070339.801210740@linuxfoundation.org> References: <20220405070339.801210740@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-2.0 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,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-kernel@vger.kernel.org From: Miaoqian Lin [ Upstream commit 9747a78d5f758a5284751a10aee13c30d02bd5f1 ] The device_node pointer is returned by of_parse_phandle() with refcount 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 Reviewed-by: Jeff Johnson Signed-off-by: Kalle Valo Link: https://lore.kernel.org/r/20220308070238.19295-1-linmq006@gmail.com Signed-off-by: Sasha Levin --- 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); -- 2.34.1