From patchwork Wed Oct 19 08:27:54 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Greg KH X-Patchwork-Id: 4727 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:4ac7:0:0:0:0:0 with SMTP id y7csp214068wrs; Wed, 19 Oct 2022 02:11:49 -0700 (PDT) X-Google-Smtp-Source: AMsMyM7LwNzXfSuhNlvYUT1pv1l4JEaudhWjeWFh5u5/Kno+y6eEmNXlliMV/huVZPtiBWEddp2V X-Received: by 2002:a05:6402:c4d:b0:457:99ec:1837 with SMTP id cs13-20020a0564020c4d00b0045799ec1837mr6392593edb.86.1666170709597; Wed, 19 Oct 2022 02:11:49 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1666170709; cv=none; d=google.com; s=arc-20160816; b=PXJHcU9cCcbaMI+6MYOaXHyJ5SoYxJG/B/q9uh3IHcP5K0RDp6JwncwUCH3LuDBbLv LKnAYh6NWpueMSdlxT4EFJR6HC6ldLMcfKOBR1F156gxMimhLkixp7PvBidRmmSFsm3H 5NoM8sR43ucee75dM3GnPP7rygbiLiQtdP4Db34RCXeBzoxUDm3PaJ2o4n1oA8wXqdbA ovPCOziEmbMIuZ96zgOXoDk/QEb+g9viY/FziU6VU1HS2ANh+3KHdxZuvw5XykDpTDfV /ItdKpkTEFV5hMwedxb72dvx5rKi/sgQB8I7KqWn5aQuqNzcwRcQ4YXOt1paQfSVDevp 5KsA== 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 Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id y102-20020a50bb6f000000b00459aa5aafaesi13389488ede.429.2022.10.19.02.11.23; Wed, 19 Oct 2022 02:11:49 -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 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 X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1747106618189367812?= X-GMAIL-MSGID: =?utf-8?q?1747106618189367812?= 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; }