From patchwork Mon Oct 24 11:29:03 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Greg KH X-Patchwork-Id: 9938 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:6687:0:0:0:0:0 with SMTP id l7csp599671wru; Mon, 24 Oct 2022 11:46:24 -0700 (PDT) X-Google-Smtp-Source: AMsMyM5PgfE3BATCEUkvUVjSZVbMe//N2q7QeeGZVy1qAexHa/JV27GTXV8sUt8VutRnQv1m3dl2 X-Received: by 2002:a63:4c23:0:b0:45f:eab4:4f47 with SMTP id z35-20020a634c23000000b0045feab44f47mr29313673pga.532.1666637184211; Mon, 24 Oct 2022 11:46:24 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1666637184; cv=none; d=google.com; s=arc-20160816; b=YaVNUosKRwxYb6y7GETiYS6i64QNnnUI4fgy5y8PIdN+9fBUzO0SXwRetlet6nclF9 0E6sPwEUGsNxtAGfLJhEb7lsJqKpqXJLDxUfYi9uq8c77PvHQ8QsUEejbIxl/P3A46s+ rLFixGnTJz0OOzTOOrqpfpClO02aF2Xdv5X//TVJgvUJ2SjuESwU/LzaGEHpEgYALJb3 QdOcmlmElhhy7eyU5eaXJhjzbKBPM5Fq1jTlnsYSWQejaykkPY1n26FDfUv0IH0ZIj4A EqzdDOWYCG6BM2K9ALrs2YZ8fRkYyG5IJhqkuKDvA77vWnw6gsjor00yB9JWnOh8Y2XL bvTA== 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=sAWuKxm5KE5yho2DHO6WVJq2sT80b5mYbiICUduid8U=; b=euE1Ni74agFJiHGDP0VOTFXNWErQzpmVTKWQRToRNaRsAhFzm2s9LTvE6zkMQpCMiz oK+wbxRLVem9yxmAdhm/SCQHhwErD+Z5AYRnQKw+m5mC2c6PQ1rpNo7cEQW0RQCthsbh NatQmnhUA4+pIqjLmXpnFR+kFFVu45YSCxI39dC1Ud0eLnds+bozsGrxV4q6h9MYw3s0 cC0n1XFd4C05WP+DyZrgKAmhBGeidDxSok0h96uk4aKI+ykE34i8rpcSLMyq8JqSBDVT iO44bnnjVeSyVBmtQjQd/NZKLLO4Fh8OEoqhw5aalixrgGBetKg8CiGHNfub4rnG1SMu RwYQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=sothYbKg; 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 a6-20020a170902ecc600b0017893539e50si273794plh.522.2022.10.24.11.46.11; Mon, 24 Oct 2022 11:46:24 -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=sothYbKg; 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 S232572AbiJXSpl (ORCPT + 99 others); Mon, 24 Oct 2022 14:45:41 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:41890 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232523AbiJXSpQ (ORCPT ); Mon, 24 Oct 2022 14:45:16 -0400 Received: from sin.source.kernel.org (sin.source.kernel.org [IPv6:2604:1380:40e1:4800::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id E5CA4C512A; Mon, 24 Oct 2022 10:27:02 -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 sin.source.kernel.org (Postfix) with ESMTPS id EAA43CE13C8; Mon, 24 Oct 2022 12:24:11 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id E9E17C433C1; Mon, 24 Oct 2022 12:24:09 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1666614250; bh=+6nKuQUQQhp/DPGhaTRSC6cZh6rw96mQOZjAlDCFnuo=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=sothYbKga48qqB6HaYjr2IHB/Smfnr/V9K9tE7zKSRcfNuVa3ftanL2zUL1ORf7a6 HvBtsTl1vKgzNeunvEix7CC+DNeLixken5fUzUcy86Gb4fzBEASzXIVBVdoMJ5vNvh pTmWKI1RjMD8eWWqfD2rXA90Bw2XKUJDR2rz8UjU= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Liang He , Rob Herring , Daniel Vetter , Sasha Levin Subject: [PATCH 5.10 146/390] drm:pl111: Add of_node_put() when breaking out of for_each_available_child_of_node() Date: Mon, 24 Oct 2022 13:29:03 +0200 Message-Id: <20221024113028.907439438@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?1747595751994181923?= X-GMAIL-MSGID: =?utf-8?q?1747595751994181923?= From: Liang He [ Upstream commit e0686dc6f2252e009c455fe99e2ce9d62a60eb47 ] The reference 'child' in the iteration of for_each_available_child_of_node() is only escaped out into a local variable which is only used to check its value. So we still need to the of_node_put() when breaking of the for_each_available_child_of_node() which will automatically increase and decrease the refcount. Fixes: ca454bd42dc2 ("drm/pl111: Support the Versatile Express") Signed-off-by: Liang He Reviewed-by: Rob Herring Signed-off-by: Daniel Vetter Link: https://patchwork.freedesktop.org/patch/msgid/20220711131550.361350-1-windhl@126.com Signed-off-by: Sasha Levin --- drivers/gpu/drm/pl111/pl111_versatile.c | 1 + 1 file changed, 1 insertion(+) diff --git a/drivers/gpu/drm/pl111/pl111_versatile.c b/drivers/gpu/drm/pl111/pl111_versatile.c index bdd883f4f0da..963a5d5e6987 100644 --- a/drivers/gpu/drm/pl111/pl111_versatile.c +++ b/drivers/gpu/drm/pl111/pl111_versatile.c @@ -402,6 +402,7 @@ static int pl111_vexpress_clcd_init(struct device *dev, struct device_node *np, if (of_device_is_compatible(child, "arm,pl111")) { has_coretile_clcd = true; ct_clcd = child; + of_node_put(child); break; } if (of_device_is_compatible(child, "arm,hdlcd")) {