From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 76264C433EF for ; Tue, 8 Mar 2022 02:03:22 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S244485AbiCHCEP (ORCPT ); Mon, 7 Mar 2022 21:04:15 -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> 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 From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 3AC40C433F5 for ; Tue, 8 Mar 2022 02:03:42 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:In-Reply-To:MIME-Version:References: Message-ID:Subject:Cc:To:From:Date:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=ryuLZTFwEMCSsL8fT4IXyXCQ/mOuRvsgOeoxITLV39o=; b=xUY+BFdgr7NRnI soc9YFqaSOlv+gqvKPEFu8Fb8RTaV9H+NrKST7t9x2yci6KR5JWeQm+r7871LoUaLzVWpc2u/JYTx 0R2F07SLvH71TRjt7RfJutEzuxMbxuF2P3pf5r1XNqLiPuisQk55aUSumkFDOElXbDhi0b1/S45GH iQfEoZKyld4FAno4TvjmqAbc2oK2yZZEUoaAG0gZ3XGfIbX/zv+oGB1+DlD91b2ADCZilqo/WX1Ma EN4j39066cJH4LGw9TXWZQEsqoiK9X5BklW1u3ey3zkIZf6i+w1a1cPnQCo60xB7/bDnnIGKtimdU Ceo6sz6Cu6X73Lq75uTA==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1nRPCF-002POu-4G; Tue, 08 Mar 2022 02:03:31 +0000 Received: from dfw.source.kernel.org ([2604:1380:4641:c500::1]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1nRPC0-002PKR-Jl; Tue, 08 Mar 2022 02:03:17 +0000 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 9DA12614D8; 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-Disposition: inline In-Reply-To: <20220307131924.9905-1-linmq006@gmail.com> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20220307_180316_740497_CFC79D37 X-CRM114-Status: GOOD ( 13.78 ) X-BeenThere: linux-mediatek@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "Linux-mediatek" Errors-To: linux-mediatek-bounces+linux-mediatek=archiver.kernel.org@lists.infradead.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 _______________________________________________ Linux-mediatek mailing list Linux-mediatek@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-mediatek From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from alsa0.perex.cz (alsa0.perex.cz [77.48.224.243]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 3149BC433F5 for ; Tue, 8 Mar 2022 02:04:22 +0000 (UTC) Received: from alsa1.perex.cz (alsa1.perex.cz [207.180.221.201]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by alsa0.perex.cz (Postfix) with ESMTPS id 584B317A2; Tue, 8 Mar 2022 03:03:30 +0100 (CET) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa0.perex.cz 584B317A2 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=alsa-project.org; s=default; t=1646705060; bh=+5Cyq8EnO4Z7dInU7QtRiRgZkFYM1vfMImCrh3hisB0=; h=Date:From:To:Subject:References:In-Reply-To:Cc:List-Id: List-Unsubscribe:List-Archive:List-Post:List-Help:List-Subscribe: From; b=K3ohbhGflPeVVhq7laNYxnwCXQtuyTGQR5XXHlwXa75oHL8C/W8iAhAI3iBYJp6Kf 5rraeu+flUMfWtsMaE2mAAmreUAwWklvvqVIXlwIIblrfvbr0aPTYONHHy2oJBIN+5 JK9SRXX539EGAdLJ6Cq4+2W4AxVuI++IPaHpFR5g= Received: from alsa1.perex.cz (localhost.localdomain [127.0.0.1]) by alsa1.perex.cz (Postfix) with ESMTP id 061FBF80132; Tue, 8 Mar 2022 03:03:30 +0100 (CET) Received: by alsa1.perex.cz (Postfix, from userid 50401) id E7875F8013F; Tue, 8 Mar 2022 03:03:28 +0100 (CET) Received: from dfw.source.kernel.org (dfw.source.kernel.org [IPv6:2604:1380:4641:c500::1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by alsa1.perex.cz (Postfix) with ESMTPS id 62E9BF800E9 for ; Tue, 8 Mar 2022 03:03:17 +0100 (CET) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa1.perex.cz 62E9BF800E9 Authentication-Results: alsa1.perex.cz; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="ifIYXJSu" 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 9DA12614D8; 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 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> Cc: alsa-devel@alsa-project.org, linux-kernel@vger.kernel.org, Takashi Iwai , Jiaxin Yu , Liam Girdwood , Mark Brown , linux-mediatek@lists.infradead.org, Shunli Wang , Matthias Brugger , linux-arm-kernel@lists.infradead.org X-BeenThere: alsa-devel@alsa-project.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: "Alsa-devel mailing list for ALSA developers - http://www.alsa-project.org" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: alsa-devel-bounces@alsa-project.org Sender: "Alsa-devel" 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 From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 13294C433F5 for ; Tue, 8 Mar 2022 02:04:30 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:In-Reply-To:MIME-Version:References: Message-ID:Subject:Cc:To:From:Date:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=Wn17LC4bf6DHBDowLDB2qffBFyCV1+D8ipiPOOYkuns=; b=KOAicn3ay6xwYB pF+LerwxRNdAe9uFQE1n1yg/ytr5TTKopd1PbhmiH5It7gY0hcOnd/s8UHgKLrOg9diypQXkLqzmS U8LRVJrBySCdvG1JWyDyStF47KfxGPAgI/ZmDKnlmH7KLRvuqQDCkt3Vi8W3EbMT9U/WrNQFwQ2tQ SD70we0ZaegOy3o1HnFKnHKbRnh+I7wQ/HjBXClXp05lQhFJXcTQ+0107ZHJU4JiRWhRUWANoZ8vl kcUhw+bI7uB37sq1XTU+az/CxfXv8YJoPGCA6zTDYwcbg07VrBPCb4tUg4GiMVCB1A4d+tqnfwAty q/AzAZ0D6z/w5yzSHp7A==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1nRPC3-002PLM-KN; Tue, 08 Mar 2022 02:03:19 +0000 Received: from dfw.source.kernel.org ([2604:1380:4641:c500::1]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1nRPC0-002PKR-Jl; Tue, 08 Mar 2022 02:03:17 +0000 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 9DA12614D8; 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-Disposition: inline In-Reply-To: <20220307131924.9905-1-linmq006@gmail.com> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20220307_180316_740497_CFC79D37 X-CRM114-Status: GOOD ( 13.78 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.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 _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel