Received: by 2002:a05:6358:1087:b0:cb:c9d3:cd90 with SMTP id j7csp644097rwi; Thu, 27 Oct 2022 06:05:03 -0700 (PDT) X-Google-Smtp-Source: AMsMyM411DQBUa/KeMD+v8lmEwbxqs54ESY1ygEJJ+uF8ePQTi5h694MGBEmY4mPmmoGDWsgZS9R X-Received: by 2002:a17:907:7611:b0:78d:9d69:adf9 with SMTP id jx17-20020a170907761100b0078d9d69adf9mr42752453ejc.283.1666875902915; Thu, 27 Oct 2022 06:05:02 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1666875902; cv=none; d=google.com; s=arc-20160816; b=ML5jFCJn0iiqyacJ8ETeltFd658ebp/SgS8KBXYHhNyfptNOGIxsRlJ9W7HS+w4aP3 Xy4hvjX2MDrXkqYQYY3rnk/JpM+zb41xY0lxSWkmCO4Sq5a4b7islE3lovcXULYxkbM6 ZzfxRk+GBDYimbmxZeF5KQ2QphOPIzCi0dBlTdZMUPXowQnrp+tUoYc24Lx3sgZFf+pm dNV54D/zNgCHx933i1YMckPN6HHuwwudsBk4OEZfF3fN38lvN4XObZLfzxPnWPRg5J2e sJtLLMDf9cAPchJdkePwrpYI6cloSLJRx8uhSOVuApAxm+we1VdAshtOKFQ68PPGY8jQ gQGg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date; bh=B1nTTqW/JNcg0fgUYzhiBfvS1weUjfq4Sx7SMzFpz+E=; b=XLAyiBwfiiUCDDdIlKPCzfvFQFF4cb2uSDuT6dlfkxHZXQswd1ogmVWaJFbD+klqXW C6gpchb5Yn2hg+KF0nuK7L+5iFX1TtEWIqEWvhScrbDAKw8PwA8M7JH8U0kBB/HIAT4C MaJT9snKK/DvwPCIIku9/v/s7GQYFfzrGcrCsQVPWMhBwfXRMnqyCmGiq9hcx8R17VjX hN6iyj7gtsgt7KZqbOqGb33cRRKKr3JB3Xz/NbaAGW+Sc0IjN0eTcaIuYGsKfPb2rKWd XJAZsazvrbzXgPHsOKFT7P7516cvM8nvfnV2Q33N7sBmiWu1guyOT5mqKmXoGZIbPZ0v a0KQ== ARC-Authentication-Results: i=1; mx.google.com; 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=fail (p=NONE sp=NONE dis=NONE) header.from=arm.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id hg2-20020a1709072cc200b007a9d456583bsi1423733ejc.62.2022.10.27.06.04.08; Thu, 27 Oct 2022 06:05:02 -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; 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=fail (p=NONE sp=NONE dis=NONE) header.from=arm.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235774AbiJ0MrA (ORCPT + 99 others); Thu, 27 Oct 2022 08:47:00 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:33922 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235799AbiJ0Mqw (ORCPT ); Thu, 27 Oct 2022 08:46:52 -0400 Received: from foss.arm.com (foss.arm.com [217.140.110.172]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 40414168E76 for ; Thu, 27 Oct 2022 05:46:40 -0700 (PDT) Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.121.207.14]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id A6ACA23A; Thu, 27 Oct 2022 05:46:46 -0700 (PDT) Received: from bogus (e103737-lin.cambridge.arm.com [10.1.197.49]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id 817133F7B4; Thu, 27 Oct 2022 05:46:39 -0700 (PDT) Date: Thu, 27 Oct 2022 13:46:37 +0100 From: Sudeep Holla To: Pierre Gondois Cc: linux-kernel@vger.kernel.org, Rob.Herring@arm.com, Rob Herring , Greg Kroah-Hartman , "Rafael J. Wysocki" Subject: Re: [PATCH] cacheinfo: Decrement refcount in cache_setup_of_node() Message-ID: <20221027124637.ygsxyqe6kztudqce@bogus> References: <20221026185954.991547-1-pierre.gondois@arm.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20221026185954.991547-1-pierre.gondois@arm.com> X-Spam-Status: No, score=-4.2 required=5.0 tests=BAYES_00,RCVD_IN_DNSWL_MED, SPF_HELO_NONE,SPF_NONE 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 On Wed, Oct 26, 2022 at 08:59:54PM +0200, Pierre Gondois wrote: > Refcounts to DT nodes are only incremented in the function > and never decremented. Decrease the refcounts when necessary. > Thanks for fixing this. I had observed this once before but I wasn't sure on of_node_get usage in general. Since we assign and use device_node pointers for comparison later, should be keep the reference or drop it. I still don't know and keep getting such questions whenever I touch anything around device_node reference. IIUC as long as we don't use that you access the node itself, we are safe to drop the reference. That said, this change looks good to me. Reviewed-by: Sudeep Holla -- Regards, Sudeep