Received: by 2002:a05:6358:4e97:b0:b3:742d:4702 with SMTP id ce23csp2928123rwb; Mon, 15 Aug 2022 14:13:39 -0700 (PDT) X-Google-Smtp-Source: AA6agR5L8MZ552W8ssyPfhGiDYkXypXzN7TsL7qfCZfgK2ITc/NDTbELJwQsndUsRTjhnY3YgS05 X-Received: by 2002:aa7:c3d1:0:b0:43c:c713:fac8 with SMTP id l17-20020aa7c3d1000000b0043cc713fac8mr16172625edr.371.1660598019674; Mon, 15 Aug 2022 14:13:39 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1660598019; cv=none; d=google.com; s=arc-20160816; b=MF2qemac2wNes6NgYn7y7NOQIlIWf2Jf9ZBRfaB67c/gwTHOYrQNtA4ELkEh9eZqZ6 Mf7f4Un87hfHmic1tPjgulPmpfp5Rb2z8WJLfL+XcGtemjHYZI/a5o6G4TPkz0wEjma5 KgE56T0IbCvfo+3rJTHB+Sztp1wyv51RsDUxRpK+PLilTMgvlUXrGGaevC118ul4oPOj wvjccXgxBipzhc3jPIZYPOW4lVWhBWYHepCnTZBv9v8K26Uzyt4KlGMguz6USk1Tv4Ck OH0hFWF29HxeZqVsMRnN/1kUKaBgAwXL2YMbItKTSd1tSPN52efgB2e6xrMKEnWVLv8/ vWcg== 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=NoTnbVxCTquGqujU9Rrd5OTlCc6zoBdy/3xVZKOyjtepNDrzEsiou41AVFQ3OPK5GD PG4aXJhQyoROlHFIQngBe/BiDS8iaG8sGTMOmZbIXdR27HDklnmJ8wZrleW6Ow0f3Vsy bnWPYAAEuoUtvx8ySuzGt2qIujEPEGrKq1PDB9vi2oCqTuDPEVh/7cryQiyelZPs5TsW DgnobGuQSgrsWXDMP1g2u9X5C0c7JoaKe0lBs2iGIDQb+adOxe7K6VVLVREP78AUz0vh Tp6tzMMm4b1bMF7zWiPUPt9SyOe7wcBmuDpxXMjJr0YMrWOTKPWH+lteCTox+44NItMv /btw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=p9WjxYuK; 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 w2-20020a1709061f0200b0072f4b12916fsi7187448ejj.395.2022.08.15.14.13.13; Mon, 15 Aug 2022 14:13:39 -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=p9WjxYuK; 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 S1346253AbiHOUf5 (ORCPT + 99 others); Mon, 15 Aug 2022 16:35:57 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:38656 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1347800AbiHOUbm (ORCPT ); Mon, 15 Aug 2022 16:31:42 -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 8A036A572B; Mon, 15 Aug 2022 12:04:49 -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 E3F26612AB; Mon, 15 Aug 2022 19:04:48 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id D5062C4347C; Mon, 15 Aug 2022 19:04:47 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1660590288; bh=ApGZls245OFaL4bZDd2zk1ckQldFOthVbDmUJI6iQH0=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=p9WjxYuK7oxJqqZ28eDeb013dF9ogDS1Q35hO8mrknaZf2J2gUrp3hmPzNV59inR4 lnsGZlosub4fOZabtd/XS54u4aLnMUzbrm4LjIRafeLIqenjNByciNbQtERILCVzKs hQCJXjpJWoIacuEzvq4OaRSscrOeNZTPj1eFMfRQ= 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.18 0213/1095] ARM: OMAP2+: Fix refcount leak in omapdss_init_of Date: Mon, 15 Aug 2022 19:53:32 +0200 Message-Id: <20220815180438.480345517@linuxfoundation.org> X-Mailer: git-send-email 2.37.2 In-Reply-To: <20220815180429.240518113@linuxfoundation.org> References: <20220815180429.240518113@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