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 B8365C433EF for ; Wed, 1 Jun 2022 06:51:19 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1343579AbiFAGvR (ORCPT ); Wed, 1 Jun 2022 02:51:17 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:49072 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S244719AbiFAGvL (ORCPT ); Wed, 1 Jun 2022 02:51:11 -0400 Received: from perceval.ideasonboard.com (perceval.ideasonboard.com [213.167.242.64]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 91B1C95A0F; Tue, 31 May 2022 23:51:09 -0700 (PDT) Received: from pendragon.ideasonboard.com (lmontsouris-659-1-41-236.w92-154.abo.wanadoo.fr [92.154.76.236]) by perceval.ideasonboard.com (Postfix) with ESMTPSA id 0AF256D1; Wed, 1 Jun 2022 08:51:03 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com; s=mail; t=1654066264; bh=I9ZmOGhYwlPu5Iw2LmEOgB3rLqHYXy5EaidCJYy1YSA=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=Jq97zO5uG0N8y3cg/druowOs8wOH2M8i2drfRBZtwxsTbvzANwqAl6UlvbQgRMg9f muk8GUR/fncZ6UL6XQA+dD3ekVnmvLBV3zrZqMtx8iJiDgXDe84nUDkBwS15mkw9ZI tC7fxk32bqI5DQGFK4MFG2m52PeE0lfYEdU7Deug= Date: Wed, 1 Jun 2022 09:50:59 +0300 From: Laurent Pinchart To: Miaoqian Lin Cc: Tony Lindgren , Russell King , Tomi Valkeinen , Sebastian Reichel , linux-arm-kernel@lists.infradead.org, linux-omap@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH] ARM: OMAP2+: Fix refcount leak in omapdss_init_of Message-ID: References: <20220601044858.3352-1-linmq006@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: <20220601044858.3352-1-linmq006@gmail.com> Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hello Lin, Thank you for the patch. On Wed, Jun 01, 2022 at 08:48:58AM +0400, Miaoqian Lin wrote: > omapdss_find_dss_of_node() calls of_find_compatible_node() to get device > node. of_find_compatible_node() returns a node pointer with refcount > incremented, we should use of_node_put() on it when done. > Add missing of_node_put() in later error path and normal path. > > Fixes: e0c827aca0730 ("drm/omap: Populate DSS children in omapdss driver") > Signed-off-by: Miaoqian Lin Reviewed-by: Laurent Pinchart > --- > arch/arm/mach-omap2/display.c | 2 ++ > 1 file changed, 2 insertions(+) > > diff --git a/arch/arm/mach-omap2/display.c b/arch/arm/mach-omap2/display.c > index 21413a9b7b6c..ed2cb2649cf6 100644 > --- a/arch/arm/mach-omap2/display.c > +++ b/arch/arm/mach-omap2/display.c > @@ -259,11 +259,13 @@ static int __init omapdss_init_of(void) > > if (!pdev) { > pr_err("Unable to find DSS platform device\n"); > + of_node_put(node); > return -ENODEV; > } > > r = of_platform_populate(node, NULL, NULL, &pdev->dev); > put_device(&pdev->dev); > + of_node_put(node); > if (r) { > pr_err("Unable to populate DSS submodule devices\n"); > return r; -- Regards, Laurent Pinchart