Received: by 2002:a05:622a:251a:b0:39a:b4a2:e86 with SMTP id cm26csp330250qtb; Wed, 19 Oct 2022 03:09:04 -0700 (PDT) X-Google-Smtp-Source: AMsMyM7HuryxD66D0taR6End77iXtHu/wlHQ3bXWSA+OO4BGLEZlhnGFktSbetUJCtofL2MeppDw X-Received: by 2002:a17:906:730e:b0:78d:94ab:77c2 with SMTP id di14-20020a170906730e00b0078d94ab77c2mr6067850ejc.639.1666174144470; Wed, 19 Oct 2022 03:09:04 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1666174144; cv=none; d=google.com; s=arc-20160816; b=p0i77fw7+HM8BPqEC9MLRf52zuKYJJbzgVsug5kAjiltvwLUHKmw4U7VvRmhfvuFHE Qh0oepRnjNBkzcAvNzs3m8JScNiVuCtdSCQFu5s+5drMGbmUWLDeNVtxmfs9zO8JTaqC 72JxnBrTfRCGxkYE5q+gPNNWAPLtilZUjpGWi8t2lsePqccYv70KOWz1jMLcTdiLjnAA oQ76XSxs4GWcPh2Na/neXf7/Cp70IFYhlV2Vs5GFFPufpwvTFpu+jF8DmtCbJXYnkxt7 kDhQ98kJCzgP/p2IKOwC+Lzj/knifxvLjo2F/s6tgY4OhxrI3/9xdWmUv2TqZ0TvNcIn gFWg== 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=UC5xUnD5vN2q0wJSEAC9uPW+rEyu7hJbWyi7VoOERw0=; b=Uu1DZa3aeGb3kMpz2UGn4b25AIrN/HeUxufO9gy4Q6U+D+92nYFVLeZ/85oJxrzE9J TRF38RJKJkBcbc728Kj8fQWOaAzZr9m+di429eBKPrzprC+IqkevZ507J04oAwuH+hO/ +7vEU7QOqWOw1f742eBZrwlLlaN4aBBeSRDIAH/uLoug9BgDoPEPsGcDaJBI63unI86E tuKquzK/pW1sBtbV7vaSOwZDlU8Ee17km4rehqdRCi6Cmsj8kD4TSuK10Ixe57fsph/i Ii+zTVN/nVTQVAXJ8Yo1KoRXjxnvJYykLyqYEUtcv6Ggv9JrkCUwv7LY8jI8328vjG62 CQQQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=JuZjoa4z; 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 go10-20020a1709070d8a00b0078d4c9d77adsi17130588ejc.94.2022.10.19.03.08.37; Wed, 19 Oct 2022 03:09:04 -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=JuZjoa4z; 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 S232334AbiJSJIR (ORCPT + 99 others); Wed, 19 Oct 2022 05:08:17 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:55442 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232318AbiJSJFb (ORCPT ); Wed, 19 Oct 2022 05:05:31 -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 ADA63F02E; Wed, 19 Oct 2022 01:59:29 -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 227C86183D; Wed, 19 Oct 2022 08:55:30 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 35D80C433C1; Wed, 19 Oct 2022 08:55:29 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1666169729; bh=Qx7YqYDAslYo7Yv+XWnm5lJu4CbNEUcbSjGorjTbQ7k=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=JuZjoa4zuAWdGBvIRWugUeMDTR9iIBtHE+HPFbfdjn/bqk3t6y+dfVAt33H0W5nQ9 fQRyyp5sU7H0Nwe+z+qaI1If9EMThw76sEvRMe9tbbGJD596k2Qasjpxo6qXrtnlBs bUH0ev1w/pJQxKIqvh6QDpSo4MpoPBjejJ4w3tRI= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Liang He , Tomi Valkeinen , Sasha Levin Subject: [PATCH 6.0 387/862] drm/omap: dss: Fix refcount leak bugs Date: Wed, 19 Oct 2022 10:27:54 +0200 Message-Id: <20221019083307.050938061@linuxfoundation.org> X-Mailer: git-send-email 2.38.0 In-Reply-To: <20221019083249.951566199@linuxfoundation.org> References: <20221019083249.951566199@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.4 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 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: Liang He [ Upstream commit 8b42057e62120813ebe9274f508fa785b7cab33a ] In dss_init_ports() and __dss_uninit_ports(), we should call of_node_put() for the reference returned by of_graph_get_port_by_id() in fail path or when it is not used anymore. Fixes: 09bffa6e5192 ("drm: omap: use common OF graph helpers") Signed-off-by: Liang He Signed-off-by: Tomi Valkeinen Link: https://patchwork.freedesktop.org/patch/msgid/20220722144348.1306569-1-windhl@126.com Signed-off-by: Sasha Levin --- drivers/gpu/drm/omapdrm/dss/dss.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/drivers/gpu/drm/omapdrm/dss/dss.c b/drivers/gpu/drm/omapdrm/dss/dss.c index 0399f3390a0a..c4febb861910 100644 --- a/drivers/gpu/drm/omapdrm/dss/dss.c +++ b/drivers/gpu/drm/omapdrm/dss/dss.c @@ -1176,6 +1176,7 @@ static void __dss_uninit_ports(struct dss_device *dss, unsigned int num_ports) default: break; } + of_node_put(port); } } @@ -1208,11 +1209,13 @@ static int dss_init_ports(struct dss_device *dss) default: break; } + of_node_put(port); } return 0; error: + of_node_put(port); __dss_uninit_ports(dss, i); return r; } -- 2.35.1