Received: by 2002:a6b:fb09:0:0:0:0:0 with SMTP id h9csp2907858iog; Mon, 27 Jun 2022 05:32:38 -0700 (PDT) X-Google-Smtp-Source: AGRyM1sISpJgLXjiVwQU102YsI2i5T33JO4bPY59Sbr6YGKP6Dlp/+Yep/uFVzsxup98uKjzbmCi X-Received: by 2002:a17:907:1c12:b0:726:a6a3:751c with SMTP id nc18-20020a1709071c1200b00726a6a3751cmr4321764ejc.683.1656333157700; Mon, 27 Jun 2022 05:32:37 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1656333157; cv=none; d=google.com; s=arc-20160816; b=dT4rW6z2h9wZsTiI39f6bUIhUJIK1PeU+LRRPB/w4LTCesu+AAvZtuHKIVBkY3zrQJ YUneTSrc/k3SuWcrm/tv+JA1tAv7WXXTyBW7oPJwhCiDnTE2NoxmCCitv1zGrZ0n4AUd 9Tpr627L4J/Qs0roKrhQV5QqlgdKgO2AxxcP5e0W1k+jPBhYf+x42LVIdaMpa9M5yTJh FtXi7r//tvT8GuhTm8f0fZECsAsbIX4WX+MR3gIvjkcUnIBDJKO4gCFvywOq113P0Wpy tHuT3T2P89KWRYkTKcOBVJDz7kl8s78Q25sg797vXex3OVJHlCDqetV8pvzXqve5JzDi 8Khw== 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=iIkEm5ow87TIrT90wY9SfQUTq4SVsIzlxdIbdmR6ogw=; b=NgFgOd7mGCjO7cJSZnFbs7SDN8ZN70ZSNFQ2eFobQFYOmad6KDpvn5DG9eSHzuidwe j6h7pLpZyn7jvU8NguwnKnGt3uJIBzHd+sQbQ8UcaSdLOo2giCCf/fhIdNusb2yl+4V4 Zxrt7qRgy9+ygCgxY1CC/ff6T3lb7GsCQrB1bmlacCSKKPXswbJo8vNsSys4GO8x8WBB 5yInCOIXspVChYqZCOwLb8rOESgrFp7KQuFrvuwgXrdTrwbzV8j6hRjx+1G7uHEpHpl+ q+WUJDkrVaCUV7pHh4ylENxqpSWmupToinMQUcETO5Gv6IRmAgxE3+4sLHmfOnmdZCYM OD2Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=Sq9wefwr; 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 o3-20020a056402438300b004359a5259e5si14729608edc.561.2022.06.27.05.32.12; Mon, 27 Jun 2022 05:32:37 -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=Sq9wefwr; 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 S239892AbiF0MBy (ORCPT + 99 others); Mon, 27 Jun 2022 08:01:54 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:55932 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S238867AbiF0Lwo (ORCPT ); Mon, 27 Jun 2022 07:52:44 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 997C7DEE6; Mon, 27 Jun 2022 04:46:08 -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 dfw.source.kernel.org (Postfix) with ESMTPS id 3536061188; Mon, 27 Jun 2022 11:46:08 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 46455C3411D; Mon, 27 Jun 2022 11:46:07 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1656330367; bh=XD01nU63sTO0XqJJuZPfLOromHDSrYBbyMEACs/xTzw=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=Sq9wefwreD5VhPE2KY0xzxIFCeDaQFqYDcHPdv8PHAM0cSFJGlA1kcj4yergMW63l +B32FCvfkIAKR6U8WZzkIRG2L1Y9dqHPuVWnpA1Wvg4iEYN6CzDkcY8qZYU9rym1pR gpxFnqnpf5vc6j8mSS6Li5BsSnb4T1abhDRI0Pg8= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Miaoqian Lin , Krzysztof Halasa , Arnd Bergmann Subject: [PATCH 5.18 172/181] ARM: cns3xxx: Fix refcount leak in cns3xxx_init Date: Mon, 27 Jun 2022 13:22:25 +0200 Message-Id: <20220627111949.672778263@linuxfoundation.org> X-Mailer: git-send-email 2.36.1 In-Reply-To: <20220627111944.553492442@linuxfoundation.org> References: <20220627111944.553492442@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-7.5 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 commit 1ba904b6b16e08de5aed7c1349838d9cd0d178c5 upstream. 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() to avoid refcount leak. Fixes: 415f59142d9d ("ARM: cns3xxx: initial DT support") Signed-off-by: Miaoqian Lin Acked-by: Krzysztof Halasa Signed-off-by: Arnd Bergmann Signed-off-by: Greg Kroah-Hartman --- arch/arm/mach-cns3xxx/core.c | 2 ++ 1 file changed, 2 insertions(+) --- a/arch/arm/mach-cns3xxx/core.c +++ b/arch/arm/mach-cns3xxx/core.c @@ -372,6 +372,7 @@ static void __init cns3xxx_init(void) /* De-Asscer SATA Reset */ cns3xxx_pwr_soft_rst(CNS3XXX_PWR_SOFTWARE_RST(SATA)); } + of_node_put(dn); dn = of_find_compatible_node(NULL, NULL, "cavium,cns3420-sdhci"); if (of_device_is_available(dn)) { @@ -385,6 +386,7 @@ static void __init cns3xxx_init(void) cns3xxx_pwr_clk_en(CNS3XXX_PWR_CLK_EN(SDIO)); cns3xxx_pwr_soft_rst(CNS3XXX_PWR_SOFTWARE_RST(SDIO)); } + of_node_put(dn); pm_power_off = cns3xxx_power_off;