From patchwork Mon Oct 24 11:29:15 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Greg KH X-Patchwork-Id: 9690 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:6687:0:0:0:0:0 with SMTP id l7csp543152wru; Mon, 24 Oct 2022 09:29:14 -0700 (PDT) X-Google-Smtp-Source: AMsMyM4zzx+mV5kdC7+5jCLOU7jDFCZOlDrtw9cHzCxW+lWUJD1gDBCHo5JmhYgorJ+CX/A5goqL X-Received: by 2002:a17:907:96a0:b0:78d:dd45:a6d4 with SMTP id hd32-20020a17090796a000b0078ddd45a6d4mr28696823ejc.643.1666628953955; Mon, 24 Oct 2022 09:29:13 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1666628953; cv=none; d=google.com; s=arc-20160816; b=vBiu5OOb+T7beZ8HxRt+6LJbYFDDbebROzm4u4jprusmdGm7vENXhws08Safeh0XX8 fVsQFlgLLawFru+EIggGVVHbsOym4iXyMvW27miTJgLL/b+lTCSM1LQB0G2Q38Fe1MAY NwWimqg392MFa1CEsxGk0UB5N+IMrgnAx/C5UFUldWqprF23PgnQCZFR5w6BpZkMwfCV wu2hI3x3Zu05IO+OdxGQTYmIyqhXqCQwN7FukYlKV240INcJR8IDnCFwaui6J5VpZWbF 1e8Y5wVYQSoN6qEbsERtWhE/puwhWlXj9XCQGlLcXwc0B1myJSyGvd5hMFpSsUGD1Bgh VVnA== 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=f6tRsyMXmPCINA/3Uhp0Lf9S0Ve0cL/bxYCf1gdfMI4=; b=RZk43MiDFRvcjidWbYF9GkEXl81tNao/s7Z+D7+fN8QNLfI6iFnCkyULmcRyqpzs7S HEct/QYQiUgKhDruQUqYHt5MeWIPmvoWy8jNNb0A4j23zD0Gflqe0JAF57mgcHPsLFLd rjgXRmGQnQJvdjnQ9s7nVUmxlPh0PztKUQt+mKYoaNFRpM+yEMdKgom7TzlHOT+kqM7Y RpcKtZPf2uWTfnGzBbTzgEONjfCguI1ZTZmvAloYnj06H0dMXWBICIRu4gI78UHlt5VT ohMz4R1CQAU6iHE1+SmwYvK/u3x9fB63XsN/tVECH0/mVO9ZEpYtwRw7DUNYUYv8Xu1w kG6w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=2A06cN83; 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 13-20020a508e4d000000b0045d8bff7b1asi168315edx.403.2022.10.24.09.28.49; Mon, 24 Oct 2022 09:29:13 -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=2A06cN83; 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 S234058AbiJXQNH (ORCPT + 99 others); Mon, 24 Oct 2022 12:13:07 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:37648 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233908AbiJXQJR (ORCPT ); Mon, 24 Oct 2022 12:09:17 -0400 Received: from ams.source.kernel.org (ams.source.kernel.org [145.40.68.75]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 3CA31386B0; Mon, 24 Oct 2022 07:59: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 ams.source.kernel.org (Postfix) with ESMTPS id 9D623B8166A; Mon, 24 Oct 2022 12:22:47 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id F04AFC433C1; Mon, 24 Oct 2022 12:22:45 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1666614166; bh=xAGYtDTCGYJp30doSFA5cS5oq9dkqvAuxKbbKOD7lIg=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=2A06cN83U7pA7EdLnWX0KePhYtl1mimOKZFMyor6PZgrZbs/Dc/eQYWSCPduDHemn tWS1Pyh6m6WxHB/w5iqpSDJYXSVz55hafugaheVjM/pQwUEQcJhen3XfZMzs+phEA9 BheOLClp8sYLuW00ydl1vfnttvIY5tY9fhDlYaqA= 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.10 158/390] drm/omap: dss: Fix refcount leak bugs Date: Mon, 24 Oct 2022 13:29:15 +0200 Message-Id: <20221024113029.428485183@linuxfoundation.org> X-Mailer: git-send-email 2.38.1 In-Reply-To: <20221024113022.510008560@linuxfoundation.org> References: <20221024113022.510008560@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?1747587122121248944?= X-GMAIL-MSGID: =?utf-8?q?1747587122121248944?= 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 6ccbc29c4ce4..d5b3123ed081 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; }