Received: by 2002:a05:6358:4e97:b0:b3:742d:4702 with SMTP id ce23csp3026886rwb; Mon, 15 Aug 2022 16:25:06 -0700 (PDT) X-Google-Smtp-Source: AA6agR4wsv6AwRLf64lVGH77ZX8xw39TWNP5qYHx7ix++IGEzEQjDhaZEfFPoCPkU9pJRaAGqDgV X-Received: by 2002:a17:907:2719:b0:730:a688:f1e4 with SMTP id w25-20020a170907271900b00730a688f1e4mr11452253ejk.425.1660605792596; Mon, 15 Aug 2022 16:23:12 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1660605792; cv=none; d=google.com; s=arc-20160816; b=QQn8c5HyXxfZUbtCIZXQmoEocqqb2hHWhjVceTH4gwu2RR4I+69AHshQ3FD7EQf6go gAHU168LsN0YegtGHX8fsuXA2cz/IiQBd7ymJCs6YSgVw7+6Hwy+8Ahr88FUbuyx4k8Y Tm5Z3G7g6R9ehti6uZh9FFmuXybA82IoSX+d3Uf1wRzT/gJ1rdmyvdjfGbbHbbLtqV8e ar8d8bNJa37XjZKIi4/jP7avZv3TUjOPdW4NOlYTh49YW/EZQ4bxhGM6LEPAyQWd/JEE 52QVNnChQthXRs/sIyWQ2jsGU76eUcL7UClJnTrfcEje8ot7KvU4Oric9JqHVBIBZDAZ E44g== 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=nwzRK5q8uMnCUZOOFv/q+Ku6ou5hgEAvLepMSHsjc+o=; b=FbB7kMlk/TZYKga5oK2Kxav+2Fn4S+T/LzkCplVmX6H79NlwYiSm35xM3EVk5XnSQg nftDZY668kCehQwqE8sxyx27lEuqTY3wVSXzY7wqM0/bO1RBbMyr9agHXGZyDna0D8G4 JEqrg1PwUC1jc/WxkYSE+A3mJyOfBRaaKWTQwBF4phyltFizRbtMR7pLm0wjZ8094d0W gchr8co7qyi7Ap3P+I2TgH05v7/CZtgWWn1UOONm6hSRMQLyhnLxXxyxAUPMJTeKIsWY niWH9anbhezpGFApFkwS12cItpYmkqTmlLGFfxPNzcJXGPCZeYaJuGX3ByywhqHGKeia voSQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=itoHAB92; 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 mm26-20020a170906cc5a00b00732b3af4684si8046021ejb.163.2022.08.15.16.22.46; Mon, 15 Aug 2022 16:23:12 -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=itoHAB92; 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 S1351889AbiHOWtf (ORCPT + 99 others); Mon, 15 Aug 2022 18:49:35 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:60738 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1352008AbiHOWrh (ORCPT ); Mon, 15 Aug 2022 18:47:37 -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 2167D7CAB0; Mon, 15 Aug 2022 12:53:14 -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 0CFA761178; Mon, 15 Aug 2022 19:53:14 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 134D3C433D6; Mon, 15 Aug 2022 19:53:12 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1660593193; bh=ApGZls245OFaL4bZDd2zk1ckQldFOthVbDmUJI6iQH0=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=itoHAB92MYakY6zfgcMcKWNEd9NXkF4touMs9mFdqBoIQlmnMzo0yk26+7XcXCRxA iNlBEsTXjkEEgv8KOfJkp55BlPCnM9RkJfFL14UervrDzU363FMQO9kmg/Y7/xhNAh FTT3jLnrWXmMw1C8QZfDr9VWIoHDfOj7AVsB6xQc= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Miaoqian Lin , Laurent Pinchart , Tony Lindgren , Sasha Levin Subject: [PATCH 5.19 0228/1157] ARM: OMAP2+: Fix refcount leak in omapdss_init_of Date: Mon, 15 Aug 2022 19:53:04 +0200 Message-Id: <20220815180448.695187206@linuxfoundation.org> X-Mailer: git-send-email 2.37.2 In-Reply-To: <20220815180439.416659447@linuxfoundation.org> References: <20220815180439.416659447@linuxfoundation.org> User-Agent: quilt/0.67 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 9705db1eff38d6b9114121f9e253746199b759c9 ] 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 Message-Id: <20220601044858.3352-1-linmq006@gmail.com> Reviewed-by: Laurent Pinchart Signed-off-by: Tony Lindgren Signed-off-by: Sasha Levin --- 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 eb09a25e3b45..8d829f3dafe7 100644 --- a/arch/arm/mach-omap2/display.c +++ b/arch/arm/mach-omap2/display.c @@ -260,11 +260,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; -- 2.35.1