Received: by 2002:a05:6358:4e97:b0:b3:742d:4702 with SMTP id ce23csp1612634rwb; Fri, 19 Aug 2022 06:40:06 -0700 (PDT) X-Google-Smtp-Source: AA6agR6n/oG5guzFIovzu39RJdaLLPwBS+yCLq7osnaLOQEHwdE8CFyfeiNcyLe9b2eN1L1IMxK+ X-Received: by 2002:a05:6402:2792:b0:43f:6873:7497 with SMTP id b18-20020a056402279200b0043f68737497mr6505009ede.175.1660916405853; Fri, 19 Aug 2022 06:40:05 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1660916405; cv=none; d=google.com; s=arc-20160816; b=ujzdqifu6RmIvMU5SyNwfBeQ4ZxpZq2vcDpZdDOmaujEblurhERuajTiuj1/QJvSQi rS8qlJcV/oYKxDqfYXubDbOkByMurQ7E2kDFEZ3VMHMo6cSBLbrwl56w8D8nOt2rF2ad TsSw90HG9Fo7SXD5UgJFMsVMswMXn29iMLJJgnCvni6jgGTcvtzaJLwpnJdFOeU2mjTQ EV87vbqPX++FAlhzDmGljiWFb0ItTTAH3xpk+/MtJy7dWvqihGRBcktpX7dHXV3tEljb MN0xFgY4H2jcHaU5ODD2aOn+cCnQ4NTPGkpMTIkBZ+eib7eW/s0MEaIjXmStRAWW+uV3 ba+w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:user-agent:in-reply-to:content-disposition :mime-version:references:message-id:subject:cc:to:from:date; bh=9GpEcksLVBpD2kD7ynKJJ/Uq6/4nmUc0rjPp9TyZnos=; b=iFkJW4m8hTzzKajE/ejTWSrZCIcdfrS7Uo+S3b4mUEfsLA1Nly8o4RCDw5RhRQCGUT S2zuSDiyhUyWEm7d1cVo8IIIJ9rR4i99WsaifWrjHk1WrUw5DRLNEGO7AKPvMBtIyxGl T4nVzyv2iorvIEUWmt7w9xgJjnqJINdjnn58Zo5Qmbw1/NDGJTU8LA6hjNCXY1J8mL4N 9DCQtdDW9dRcCFfBHv3x3NlWtIuytQrxAlSpoi/4u93gMEWp3XIt9fvYi69LaoMdas2x RUxtZoTGTFYggNXp0ijNyXOrRdY1v5vKEJi+lgcwEfgEfvWqY0brZG0vSGIq2RCaDAw7 ooKw== ARC-Authentication-Results: i=1; mx.google.com; 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 Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id lk20-20020a170906cb1400b0073cab613403si1355497ejb.215.2022.08.19.06.39.39; Fri, 19 Aug 2022 06:40:05 -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; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1349367AbiHSNRF (ORCPT + 99 others); Fri, 19 Aug 2022 09:17:05 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:55690 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1348756AbiHSNRD (ORCPT ); Fri, 19 Aug 2022 09:17:03 -0400 Received: from jabberwock.ucw.cz (jabberwock.ucw.cz [46.255.230.98]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 5C102EE4A6; Fri, 19 Aug 2022 06:17:01 -0700 (PDT) Received: by jabberwock.ucw.cz (Postfix, from userid 1017) id 1E8FE1C0003; Fri, 19 Aug 2022 15:17:00 +0200 (CEST) Date: Fri, 19 Aug 2022 15:16:59 +0200 From: Pavel Machek To: Greg Kroah-Hartman Cc: linux-kernel@vger.kernel.org, stable@vger.kernel.org, Miaoqian Lin , Mark Brown , Sasha Levin Subject: Re: [PATCH 5.15 564/779] ASoC: mediatek: mt8173: Fix refcount leak in mt8173_rt5650_rt5676_dev_probe Message-ID: <20220819131659.GD11901@duo.ucw.cz> References: <20220815180337.130757997@linuxfoundation.org> <20220815180401.426152365@linuxfoundation.org> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="bajzpZikUji1w+G9" Content-Disposition: inline In-Reply-To: <20220815180401.426152365@linuxfoundation.org> User-Agent: Mutt/1.10.1 (2018-07-13) X-Spam-Status: No, score=-1.1 required=5.0 tests=BAYES_00,SPF_HELO_NONE, SPF_NEUTRAL,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 --bajzpZikUji1w+G9 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable Hi! > From: Miaoqian Lin >=20 > [ Upstream commit ae4f11c1ed2d67192fdf3d89db719ee439827c11 ] >=20 > of_parse_phandle() returns a node pointer with refcount > incremented, we should use of_node_put() on it when not need anymore. > Fix missing of_node_put() in error paths. Is this correct? > +++ b/sound/soc/mediatek/mt8173/mt8173-rt5650-rt5676.c > @@ -256,14 +256,16 @@ static int mt8173_rt5650_rt5676_dev_probe(struct pl= atform_device *pdev) > if (!mt8173_rt5650_rt5676_dais[DAI_LINK_CODEC_I2S].codecs[0].of_node) { > dev_err(&pdev->dev, > "Property 'audio-codec' missing or invalid\n"); > - return -EINVAL; > + ret =3D -EINVAL; > + goto put_node; > } =2E.. > dev_err(&pdev->dev, "%s snd_soc_register_card fail %d\n", > __func__, ret); > =20 > +put_node: > of_node_put(platform_node); > return ret; > } In success case, platform_node is stored: dai_link->platforms->of_node =3D platform_node; I guess we should not be doing put in that case. Best regards, Pavel --=20 DENX Software Engineering GmbH, Managing Director: Wolfgang Denk HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany --bajzpZikUji1w+G9 Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iF0EABECAB0WIQRPfPO7r0eAhk010v0w5/Bqldv68gUCYv+NSwAKCRAw5/Bqldv6 8gFnAJ9yZOI3voz9OdP8eQBPwHploibRfQCgliraqSKTb2XKFtOzZf8J6KbJI5E= =77mI -----END PGP SIGNATURE----- --bajzpZikUji1w+G9--