Received: by 2002:a05:6a10:2726:0:0:0:0 with SMTP id ib38csp696964pxb; Tue, 5 Apr 2022 19:11:31 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwJN+lkvwxLVsUxCbNBSIgRXq92nFh04D6l01PZMURLStJR61weiYaTNvpmaRL9oBl9RfQz X-Received: by 2002:a05:6a00:438b:b0:4fa:a67c:7ca0 with SMTP id bt11-20020a056a00438b00b004faa67c7ca0mr6489648pfb.5.1649211091274; Tue, 05 Apr 2022 19:11:31 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1649211091; cv=none; d=google.com; s=arc-20160816; b=dGguGg6sSLOVghVSrehxKTPZLbRD19biBsuxCRN5Q++I34cFjkiD22PMt3VJAortVF tjxpMZ0DWZNCjZzF50jYxFZWGmIq2/RniLIpqI6OWiMf208mS1JCoRS96nkm9dfISjop DvcRF68hSG6ap9Ccut13//mbx3wgWbmpA07UTUJa6O1YYM00CcHHMgb05N9qTrt6TzKD UwoCXN0wNfP/Hpq+tuEaZW/j9jw97IVrw4ygI9Pi8KGRa+1nSmFxEhASNVF1gLCYF/8r HOWTiH6x2YZ6WglAJ8+MNgt/csy62P35vGydlkjkHIv+YAMmdqpF6VeO3lF2I49NL7Gn lXbg== 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=It17si/oz7mgFkSMDxc5qHoKs1Vze64tde4k7hZqU0rRTea3HxTpIktPDFsDmKeQpA T6OCljWyfne6sdlgrzS19jsNP65vQWzux+Mv5DVQq4DzS4RUY3jJG2R++pRy0LprO+UN wPTJ8TtkndKI11Dc8oXKjcRio26KX0c4cynaAXKcb6fnJ8HctT30sYVJfEaJckrCLABp MpgtwaLUOvDmKCdQklM8agpTiLDK4qNdNSrZzzGC9pTi/SuUx65QcUmCDP/nr1/bLWn9 c2O1Z6MENQ6onMsmAMWcGW65Al8bxv3wRYSelwhSFzXBCj5GDb1dSC74IPHvkaeweeS6 VS0w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=aLTWkoG+; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 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 out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id d16-20020a170902ced000b001544015be4bsi16318919plg.355.2022.04.05.19.11.16; Tue, 05 Apr 2022 19:11:31 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=aLTWkoG+; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S239641AbiDEJFm (ORCPT + 99 others); Tue, 5 Apr 2022 05:05:42 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:34700 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S238389AbiDEITD (ORCPT ); Tue, 5 Apr 2022 04:19:03 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [IPv6:2604:1380:4641:c500::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id C51185FE3; Tue, 5 Apr 2022 01:08:44 -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 dfw.source.kernel.org (Postfix) with ESMTPS id 4B38360919; Tue, 5 Apr 2022 08:08:44 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 5B8E0C385A1; Tue, 5 Apr 2022 08:08:43 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1649146123; bh=u8PxMLCYo4rYp2EXONipyGluuU3I5q0QkRQTH2Ha+LM=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=aLTWkoG+cfNCvyLaENYLfF3fsRaTbQWDO39fmsPTlUf01RWLR7PP10ke0TmkKs6j1 l04o0mxkPDJhRVr8z4yEe9R55fgLRxQGbGdJeKZhcUToLo2iN/hjkH4BYNRLGhiC92 766XUIbsTDXQkQjJcFFb8Mun9NAipKHSYb9EoQ68= 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.17 0651/1126] ath10k: Fix error handling in ath10k_setup_msa_resources Date: Tue, 5 Apr 2022 09:23:18 +0200 Message-Id: <20220405070426.739189547@linuxfoundation.org> X-Mailer: git-send-email 2.35.1 In-Reply-To: <20220405070407.513532867@linuxfoundation.org> References: <20220405070407.513532867@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=-7.1 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_HI, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=ham 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