From patchwork Mon Oct 24 11:30:08 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Greg KH X-Patchwork-Id: 8915 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:6687:0:0:0:0:0 with SMTP id l7csp434359wru; Mon, 24 Oct 2022 05:52:02 -0700 (PDT) X-Google-Smtp-Source: AMsMyM6CIZ74GhiDfHsSrLc9NEDmCS2P4iJodJgeN9gQ6wOZVEbYQiQclIOG0LU6HoP5NLK7JV1M X-Received: by 2002:aa7:d30a:0:b0:460:362e:af11 with SMTP id p10-20020aa7d30a000000b00460362eaf11mr21970364edq.256.1666615922375; Mon, 24 Oct 2022 05:52:02 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1666615922; cv=none; d=google.com; s=arc-20160816; b=ZBDHHS/P7/biALiJ3SUML/DaAgUix39DzbwXduTfGWPEmX1Xnsudml2o5adYV9oCGE x59WVrOFETwSSRjTiQKEBFPCz97kv0zquDzBYhrnx26lMtRRstMegdBkv9PaUHI++xTz hJJ59wQXqKzwLg3a22zj1hvI4JAVh+ZM/WhdTFF/xXf7CmYZrKemzeNjyMzw5XSp8pJi 78Oy8FobP7gx1CS1s8NMRv8c9JEI2wQzboH3t1MIyV5giGunYIm06oELehTBaK5J8upL PiJbOvDrnL6yo/k16kTvPsEFzpPg9Hyv8gJuNLUnth779uKapGX/XiVbf20v73rBkVH1 6FvA== 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=vGGmNLF6TLphsliy+3B1d/dm9U9+k0TPkQAauwGZYm0=; b=Su075znOdR6XwSImjLWonEwlH1kkb2U/9S0E4SYqpvlMW7xFgs/hggeILaRmEUxx/v 7IZRNMXN0Qqmj8aoy50dL7kT+uzKZcj8qLPfvU7crHiKDX0eijzuE4U+/CQA/nR2/0Lz lNlHtSdv8MQEEWX+ZkM6IsuABrGyWKjBN368iG7XRu5/Y1B5gjHDTRlNENr9UmzQgCvF LoxoDlwLG+fBnAyS2gPJGBzqjIOqivi0lRmOKa5tFykA3fabBnJqWW9aJ+oFKgTcSbHS 1IH+NInNQ/dvNTvXisWAks39Gg7VxRRFeVWgmh6IuZ85Lg0D03CdVWdLEgR0dGFeqfQA /dXQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=AlyP9nE0; 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 qb36-20020a1709077ea400b0078d93245e23si18578117ejc.791.2022.10.24.05.51.36; Mon, 24 Oct 2022 05:52:02 -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=AlyP9nE0; 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 S234279AbiJXMub (ORCPT + 99 others); Mon, 24 Oct 2022 08:50:31 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:59104 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234592AbiJXMpL (ORCPT ); Mon, 24 Oct 2022 08:45:11 -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 326F62250F; Mon, 24 Oct 2022 05:09:44 -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 835A4612C3; Mon, 24 Oct 2022 12:08:55 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 95B8CC433D6; Mon, 24 Oct 2022 12:08:54 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1666613334; bh=o4w8XgtE59JzAVRdbtF4cnGcQAvWAo4f2hVevgR+zp0=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=AlyP9nE0u2smyncLW5EOlZvWM7LzGoiIHIySRnezLdcE1ok2qCGs7N9N0tIXyK4gC 8tWJpHa2+ujGz5v1sLgQ8GM4YJhzC1sEQobhVb2MSn1Lrqv612gYyIuXqJXjhVkWvm KSYycvb8dy55mZJbNLspUpmaqQyFcDWI7LPZkXb4= 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 5.4 098/255] drm/omap: dss: Fix refcount leak bugs Date: Mon, 24 Oct 2022 13:30:08 +0200 Message-Id: <20221024113005.744434614@linuxfoundation.org> X-Mailer: git-send-email 2.38.1 In-Reply-To: <20221024113002.471093005@linuxfoundation.org> References: <20221024113002.471093005@linuxfoundation.org> User-Agent: quilt/0.67 MIME-Version: 1.0 X-Spam-Status: No, score=-7.6 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?1747573457702588386?= X-GMAIL-MSGID: =?utf-8?q?1747573457702588386?= 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 ac93dae2a9c8..7f1d0a9afafb 100644 --- a/drivers/gpu/drm/omapdrm/dss/dss.c +++ b/drivers/gpu/drm/omapdrm/dss/dss.c @@ -1173,6 +1173,7 @@ static void __dss_uninit_ports(struct dss_device *dss, unsigned int num_ports) default: break; } + of_node_put(port); } } @@ -1205,11 +1206,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; }