From patchwork Sat Oct 22 07:23:25 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Greg KH X-Patchwork-Id: 7389 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:4242:0:0:0:0:0 with SMTP id s2csp1096844wrr; Sat, 22 Oct 2022 01:06:09 -0700 (PDT) X-Google-Smtp-Source: AMsMyM5uYTLNWtUfjy2cSlQPJxZ1t4nvazG5UykDEZFjfwWc83RWP73V5C4+xS2GTt4gigis4E8v X-Received: by 2002:a17:90b:1643:b0:212:d286:bb13 with SMTP id il3-20020a17090b164300b00212d286bb13mr7437588pjb.11.1666425969285; Sat, 22 Oct 2022 01:06:09 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1666425969; cv=none; d=google.com; s=arc-20160816; b=RJs8y01nq5l71iSOhLTEj5dvcSDs1jjI92wTw0ctXHdlX9Gd5yvT7J2Etq6yM6vQTs 7Jfy9N03Cmzqem8hcT3hoHDxv3eSgImrsKdQfC3GsOAH/mvEu7k2lw415KQucnNXsB9g GIpADExxBGTJBTH4zfl/qW+j+AGbGiQmHu/zD10wEqKWulBKiFTcT+bIFSOtnVq6foUF AZxbx49G9dnR/OkI7DAy23JI+GEwfPpA4WdAfAF3Fv89/TGcqVjbnPsoGvqjqZKf10q1 USfBqgC330IRF0GFeGYFsG81Zl7dl9aTO7TxsysEk8f+Dz4rwZpcfl6jLwJFjp49n9fY I9Fg== 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=qGeltTAKNOGiCdu7UJtnbp0ESTsp0gH+OUYPsFLviVdZ1e0iRL2SL3y4Xjq9mL+Dfn tUO+tPY1oI2aGvMcs9l16TANI/0p59VYf/N3BNGKmgO9anZaAwzKtOXjjIvEmZ+H2FBV tIzEaUzHL59jhRmAkm1tXW3hHlqUr63Y9HmozMT8l01aoeqZwgaQtAKFb/wvDzsLHXcb +wX3UZFfJgJUYW/VnXozRmlEvM2/UzCOuoHDyoTeIegp37RFReaaj9FjZdRTCVCHZmQl rwwIjpaQJtJ3HUOE2+p7fYYuFI6Zix/mvoaw8GUcfv5xfI7K37fhAm1PJP7tQLDAs+n4 NgfA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=LXP6qcPO; 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 v190-20020a6389c7000000b0044c7a49befesi24926607pgd.258.2022.10.22.01.05.53; Sat, 22 Oct 2022 01:06:09 -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=LXP6qcPO; 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 S232535AbiJVIFV (ORCPT + 99 others); Sat, 22 Oct 2022 04:05:21 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:47932 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232589AbiJVH7N (ORCPT ); Sat, 22 Oct 2022 03:59:13 -0400 Received: from ams.source.kernel.org (ams.source.kernel.org [IPv6:2604:1380:4601:e00::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 9129031232; Sat, 22 Oct 2022 00:49:33 -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 4F322B82DF6; Sat, 22 Oct 2022 07:49:30 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id B3288C433C1; Sat, 22 Oct 2022 07:49:28 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1666424969; bh=Qx7YqYDAslYo7Yv+XWnm5lJu4CbNEUcbSjGorjTbQ7k=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=LXP6qcPO8lswE66ETg1coe7vaUvIyd12O/uYLpq3YGFeVqfAn9lD5v92aPB5zgsRB 9/OyrJobX2gEKLyf296BHQinga8jt4/bi8ZJeg7oHZ0LEA2YpQDm1dU8AqHwo8slmj eS0XhaIP6ubs84WPunYpIdd7xzMYh8p9PLH4rMgM= 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.19 326/717] drm/omap: dss: Fix refcount leak bugs Date: Sat, 22 Oct 2022 09:23:25 +0200 Message-Id: <20221022072509.072284582@linuxfoundation.org> X-Mailer: git-send-email 2.38.1 In-Reply-To: <20221022072415.034382448@linuxfoundation.org> References: <20221022072415.034382448@linuxfoundation.org> User-Agent: quilt/0.67 MIME-Version: 1.0 X-Spam-Status: No, score=-7.3 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?1747374277080255135?= X-GMAIL-MSGID: =?utf-8?q?1747374277080255135?= 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; }