Received: by 2002:a05:6358:4e97:b0:b3:742d:4702 with SMTP id ce23csp2929395rwb; Mon, 15 Aug 2022 14:15:07 -0700 (PDT) X-Google-Smtp-Source: AA6agR7acf4fENOzVv+7pA5n9cMQg2HdISwRoDnIdZzXyCelxcaprwe15P7D58g9G65Vu6DdYSkT X-Received: by 2002:a17:907:288a:b0:730:996d:c605 with SMTP id em10-20020a170907288a00b00730996dc605mr11049965ejc.682.1660598106918; Mon, 15 Aug 2022 14:15:06 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1660598106; cv=none; d=google.com; s=arc-20160816; b=uHKe588olxTYG2MGtDSsiqwlu9N5MEp33lvdXuwsQMhoNC8wsLtnjZqAKAYih/CQOY nXFE75M7mLhBkhJ4G/OYwEO+I3jDYCRcXw5ItHOwhdevnqsA+1paGmtTCysrnhpKGnPn pqZIUQvJz6L8rjUinlMFH2cG+AscGcL73JJ8G+0UapdyuAy0DIyzYct0k1v42XQSNZAR LkqNmfgw0daLujhOS0yLkyLcUSH6WV/alkPgiOce/yYKXZ9Rmkb1t3lLXqk/utAjvqv4 Nxto3ceCjEIPUcmVjsIqlYX7uQAs/CvUv8mOx2DZQAUk+/CNP7y5UYqeZKmt9qVSYNjh nWQQ== 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=Nz/JxdBoDSfkYx5asgxLXO3hMk1Lo6GXNqvgoj9JWD8=; b=gnyv7/DQhAg1NdodYCCFfuA6NJqYMtMkqqk5VorYkX0bq+0wRgYJafNUNWYPsaKOqw qOzKbjD9pWU+YhauQq+/EyxxAB2lzUSNoQg3W5LbeZ4Mz7l31YF3Eq11fnTT2I6nzCKN 40y2ylt2+NJs2U5I7FfZyok4qt9LINTeOGBbgcdFrKP9AHISbxbCc7SulKDZ+42WxJ5Z ZkVYO5835unnGwblYcKRdSLH46bRjkwZ6zkD42lMLJgSz8tZBUCW5LlGe2R4bC/oeXJM J8xDamBLsM3l7aTuAtEjOXgO28HEJnboIVfZTWjbqAfKfRnvcYDjJaLQBcmB/JrJpSXv QNZA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=hu9oTFbf; 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 Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id l13-20020a170906794d00b007309621c10fsi10312132ejo.699.2022.08.15.14.14.37; Mon, 15 Aug 2022 14:15:06 -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=hu9oTFbf; 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 S242678AbiHOVD1 (ORCPT + 99 others); Mon, 15 Aug 2022 17:03:27 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:33240 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1346927AbiHOVBS (ORCPT ); Mon, 15 Aug 2022 17:01:18 -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 970CEC7B9F; Mon, 15 Aug 2022 12:13:19 -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 ACEB4B81116; Mon, 15 Aug 2022 19:13:17 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id D5874C433C1; Mon, 15 Aug 2022 19:13:15 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1660590796; bh=AZdgHdd7Lzfg2eg8h8WDpyyCu/wK8MepgvhUm1bY0G8=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=hu9oTFbfu7vCy908yzbPPp+IUdoy+c7l5WmjS8hme9q91Uf8ZNkNl8R8LoPLryHiL wk1dYKVNNvza7xYY9sUvaGTp5g9bDTZ/q4l4E4S+4DLcgdu72GiGkWCz5zt8oTQhhS qp0TnISJ5iFLZO6iINjfwgPAQzuiLfCHNvAkf5Lk= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Miaoqian Lin , Linus Walleij , Sasha Levin Subject: [PATCH 5.18 0374/1095] drm/mcde: Fix refcount leak in mcde_dsi_bind Date: Mon, 15 Aug 2022 19:56:13 +0200 Message-Id: <20220815180445.182185394@linuxfoundation.org> X-Mailer: git-send-email 2.37.2 In-Reply-To: <20220815180429.240518113@linuxfoundation.org> References: <20220815180429.240518113@linuxfoundation.org> User-Agent: quilt/0.67 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-7.1 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,T_SCC_BODY_TEXT_LINE 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 From: Miaoqian Lin [ Upstream commit 3a149169e4a2f9127022fec6ef5d71b4e804b3b9 ] Every iteration of for_each_available_child_of_node() decrements the reference counter of the previous node. There is no decrement when break out from the loop and results in refcount leak. Add missing of_node_put() to fix this. Fixes: 5fc537bfd000 ("drm/mcde: Add new driver for ST-Ericsson MCDE") Signed-off-by: Miaoqian Lin Signed-off-by: Linus Walleij Link: https://patchwork.freedesktop.org/patch/msgid/20220525115411.65455-1-linmq006@gmail.com Signed-off-by: Sasha Levin --- drivers/gpu/drm/mcde/mcde_dsi.c | 1 + 1 file changed, 1 insertion(+) diff --git a/drivers/gpu/drm/mcde/mcde_dsi.c b/drivers/gpu/drm/mcde/mcde_dsi.c index 5651734ce977..9f9ac8699310 100644 --- a/drivers/gpu/drm/mcde/mcde_dsi.c +++ b/drivers/gpu/drm/mcde/mcde_dsi.c @@ -1111,6 +1111,7 @@ static int mcde_dsi_bind(struct device *dev, struct device *master, bridge = of_drm_find_bridge(child); if (!bridge) { dev_err(dev, "failed to find bridge\n"); + of_node_put(child); return -EINVAL; } } -- 2.35.1