Received: by 2002:a05:6358:4e97:b0:b3:742d:4702 with SMTP id ce23csp2807933rwb; Mon, 15 Aug 2022 11:45:21 -0700 (PDT) X-Google-Smtp-Source: AA6agR5/pmkIZ/Wsok2crq4IkpoX/zJw78u6wOEe890ET1jyDBsxeLn/pYuX4s68avmgeTVr24kP X-Received: by 2002:a05:6402:5508:b0:43a:896e:8edd with SMTP id fi8-20020a056402550800b0043a896e8eddmr15367163edb.203.1660589120954; Mon, 15 Aug 2022 11:45:20 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1660589120; cv=none; d=google.com; s=arc-20160816; b=oSo0i6qOjckfcmnqgRnZPKm/VuMkASdCXz4LctyuITl1CJC60d/DIMzpfbOPeMiEyi 5dYwlAmfIFtXihOf5TZOBPqbefqG1LGtefZKOdxz9UpttdJvD0a9cFq5z074+UiKER9E YavHKq4Ti22DFNmOdDQ7g8+uKNIYGdxTR0A1+oEyFPqy4ds6h/tOqgqaVF8EebsuNGEE 0zPAP/kpQrEDQuOaWEGp8TzTDGutA8bJrzo2xKsRPIM6VXaycLkscWw4Fak79dmw6P9Q XW1o0HtY3cxFAzSAqPKM1SKq0k5/dXu7wn9QAYnj5n5Ri63kKNl0+4ut+Un68GskWtM/ NIxQ== 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=nwzRK5q8uMnCUZOOFv/q+Ku6ou5hgEAvLepMSHsjc+o=; b=H/QLb1cHjeUZX0PLtYRLj5P1ZAi57kqxx1dGEavgxkeKjJtXohi/cgN5zYwFX2bLUT Wc7VjbzNn1SGVRhiRVSEiVcARHZGZ26b+nzvwEbMoSHv5RHJeaMzmTdJzmt7gTR9/zDn Bh4DHQ4XgtqwbsJ2YeVHJIISNYslPXtroeqEa2JErdxwQO7A1rzorE5fPvkQlbtiHlD5 XaVKXsGuCOy6xr9atbKx+hbFOgTOXsYHtxs0hTF9UIorqNh8Ibb0i9E25DI3B5PVd8tZ zWgwjIjQ5dhK+6+lU/qk2k6foIx6PyH8H8rIQPM5BcZIo7l41VLs90FWkRPY57h05rI1 cKkg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=BqxyQpKY; 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 sb39-20020a1709076da700b0072eff8bb1easi8837327ejc.672.2022.08.15.11.44.55; Mon, 15 Aug 2022 11:45:20 -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=BqxyQpKY; 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 S243743AbiHOShD (ORCPT + 99 others); Mon, 15 Aug 2022 14:37:03 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:42298 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S243521AbiHOSev (ORCPT ); Mon, 15 Aug 2022 14:34:51 -0400 Received: from ams.source.kernel.org (ams.source.kernel.org [145.40.68.75]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 924D52C13F; Mon, 15 Aug 2022 11:22:26 -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 28F48B80F99; Mon, 15 Aug 2022 18:22:24 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 78ACFC433C1; Mon, 15 Aug 2022 18:22:22 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1660587743; bh=ApGZls245OFaL4bZDd2zk1ckQldFOthVbDmUJI6iQH0=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=BqxyQpKY/jpqzS6PLkPKx+Yc+cBJqmnN4jS2PBuQHlPklWqi/shj28Zz8IzhBeTgi SGnZ/Fg4FVpXKmZ6FIsqwFo44SFm0pibuxZs3n1lowbZcMw/e2VleinOWoCHd6gAXY QGtLx1XHt3xqrLgwajEHAwNyKI03puUzz45nar74= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Miaoqian Lin , Laurent Pinchart , Tony Lindgren , Sasha Levin Subject: [PATCH 5.15 180/779] ARM: OMAP2+: Fix refcount leak in omapdss_init_of Date: Mon, 15 Aug 2022 19:57:04 +0200 Message-Id: <20220815180344.949179655@linuxfoundation.org> X-Mailer: git-send-email 2.37.2 In-Reply-To: <20220815180337.130757997@linuxfoundation.org> References: <20220815180337.130757997@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 9705db1eff38d6b9114121f9e253746199b759c9 ] omapdss_find_dss_of_node() calls of_find_compatible_node() to get device node. of_find_compatible_node() returns a node pointer with refcount incremented, we should use of_node_put() on it when done. Add missing of_node_put() in later error path and normal path. Fixes: e0c827aca0730 ("drm/omap: Populate DSS children in omapdss driver") Signed-off-by: Miaoqian Lin Message-Id: <20220601044858.3352-1-linmq006@gmail.com> Reviewed-by: Laurent Pinchart Signed-off-by: Tony Lindgren Signed-off-by: Sasha Levin --- arch/arm/mach-omap2/display.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/arch/arm/mach-omap2/display.c b/arch/arm/mach-omap2/display.c index eb09a25e3b45..8d829f3dafe7 100644 --- a/arch/arm/mach-omap2/display.c +++ b/arch/arm/mach-omap2/display.c @@ -260,11 +260,13 @@ static int __init omapdss_init_of(void) if (!pdev) { pr_err("Unable to find DSS platform device\n"); + of_node_put(node); return -ENODEV; } r = of_platform_populate(node, NULL, NULL, &pdev->dev); put_device(&pdev->dev); + of_node_put(node); if (r) { pr_err("Unable to populate DSS submodule devices\n"); return r; -- 2.35.1