Received: by 2002:a05:6a10:413:0:0:0:0 with SMTP id 19csp2900869pxp; Tue, 8 Mar 2022 04:17:47 -0800 (PST) X-Google-Smtp-Source: ABdhPJx63vRchwh8fHs/dEeWYNdf290SymKFcT93Yq32MrveRO8Z+knjl4qunKvY6xKgg86nry9f X-Received: by 2002:a63:e5f:0:b0:374:62d8:c551 with SMTP id 31-20020a630e5f000000b0037462d8c551mr13939602pgo.129.1646741867476; Tue, 08 Mar 2022 04:17:47 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1646741867; cv=none; d=google.com; s=arc-20160816; b=eSD3EElw1W2qSdJSvV6WfDyfTomYZdOAWTAZGEervM1PlIQEBGOq13EEshmNEgCm9E 68wE9FklpY7B89zIOMAoox4P+yXJWXv4M+KRqMq/jyZVIqGmU+b8BxXe17wdU8pWJfd6 cGMcw76f7LpWzWSNFg4J3365ihLs+vaj479MOtdOGq6hl0ONQt+6qhSpLVMXX21fswx4 jzB40NOHkxehLMs4089mCTJlDN4uRA4vLc76gk/t1TGaZyYThKBQx/CRUFOcNYC7uAP5 hKLkCif/8x0+EIYL9sYABZDLB73dZkZA2W2YvzNamW0flAH4J6TKiSyqzX/hqEoEE70J xMmQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=st6x75gH0mtM7SAaGVv/qqu0lHw+iAXLZ3Kty0IUuag=; b=wrShGMYKOJaUPHpSXT24oSwkKvf+oisF27ABqWUOg1hT9cn5+r1eclN29r084EUWxi YpFGVRQ85IEpgkqIshFBReiN62fyNrTKSU7XT2/44c7IzTQUzE0SFe29Zp/uFkGt1yZ2 PsCCd8e6DCcQWhH3D7y2NpjousQdRom2Gn4kRvB7sUnUYzgOSPW96tWyQkg8I5+lQ11q hTCLA0E7fXC9s89OCYvjZvPZCUbrDTr3+yTjXoYWrL4f3Kb9GKMacH7hcsHolM2MkNEL zx6ApbR+nYltRXw+8UQStSJOp5L3p5cxE/gS6Jas+9tV0s/Oy656wkFEc3RppHu5lr79 rCcA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=ifIYXJSu; 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=kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id i4-20020a17090a65c400b001bd4aa6bd2esi2132249pjs.80.2022.03.08.04.17.30; Tue, 08 Mar 2022 04:17:47 -0800 (PST) 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=@kernel.org header.s=k20201202 header.b=ifIYXJSu; 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=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S243515AbiCHCEN (ORCPT + 99 others); Mon, 7 Mar 2022 21:04:13 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:32970 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231477AbiCHCEM (ORCPT ); Mon, 7 Mar 2022 21:04:12 -0500 Received: from dfw.source.kernel.org (dfw.source.kernel.org [IPv6:2604:1380:4641:c500::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 30DCE21837 for ; Mon, 7 Mar 2022 18:03:16 -0800 (PST) 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 AC504614D9 for ; Tue, 8 Mar 2022 02:03:15 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id EA9CBC340E9; Tue, 8 Mar 2022 02:03:12 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1646704995; bh=+5Cyq8EnO4Z7dInU7QtRiRgZkFYM1vfMImCrh3hisB0=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=ifIYXJSuREhd5QQVQga5BeJFLiCsR1g1uDKO0QrsvhcDiPk+KayzNVPr3R5uFxXtU 0R6eiP6w+170ffXBRqJGHRvNYLoJzSG4/kYczFZ3cpe9K1Wz4yzz67smC/s7/7PJ1L Jdb9s7Al3sCILD4PNdpilQ46XSiBxZ9kMd1gRhnNmdeU6IBDiWraCMDiNWjFCHkJrV 5I1IQ53j4itSWaaYX9T+ZfFY4xwY9ucEY5fRcFkw9F6ZHPS84yRaM+rFL/nN2Bm8Rp dYbSBVspq1f8xJ5h4ZkV9ElhpanKR2BFOllKBWJhmFmG49fTj0jBzfSr4LcA1ll8RD wp+cvIJn0ZKXg== Date: Tue, 8 Mar 2022 10:03:10 +0800 From: Tzung-Bi Shih To: Miaoqian Lin Cc: Liam Girdwood , Mark Brown , Jaroslav Kysela , Takashi Iwai , Matthias Brugger , Jiaxin Yu , Shunli Wang , alsa-devel@alsa-project.org, linux-arm-kernel@lists.infradead.org, linux-mediatek@lists.infradead.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH] ASoC: mediatek: Fix error handling in mt8183_da7219_max98357_dev_probe Message-ID: References: <20220307131924.9905-1-linmq006@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20220307131924.9905-1-linmq006@gmail.com> X-Spam-Status: No, score=-7.6 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 On Mon, Mar 07, 2022 at 01:19:21PM +0000, Miaoqian Lin wrote: > 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 paths. > Fix this by calling of_node_put() in error handling too. > > Fixes: ebbddc75bbe8 ("ASoC: Mediatek: MT8183: Add machine driver with DA7219") I am not sure if the Fixes tag makes sense. ebbddc75bbe8 is the first commit for the file; however, we have some more commits in between tip and ebbddc75bbe8. > Signed-off-by: Miaoqian Lin With the minor comment, Reviewed-by: Tzung-Bi Shih