From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 11F75C5ACB3 for ; Fri, 17 Nov 2023 11:14:34 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231165AbjKQLOf convert rfc822-to-8bit (ORCPT ); Fri, 17 Nov 2023 06:14:35 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:38174 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229436AbjKQLOb (ORCPT ); Fri, 17 Nov 2023 06:14:31 -0500 Received: from mail.astralinux.ru (mail.astralinux.ru [217.74.38.119]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 1D04311F; Fri, 17 Nov 2023 03:14:25 -0800 (PST) Received: from localhost (localhost.localdomain [127.0.0.1]) by mail.astralinux.ru (Postfix) with ESMTP id 4136F1864DDA; Fri, 17 Nov 2023 14:14:22 +0300 (MSK) Received: from mail.astralinux.ru ([127.0.0.1]) by localhost (rbta-msk-vsrv-mail01.astralinux.ru [127.0.0.1]) (amavisd-new, port 10032) with ESMTP id dJQkUJDBA1fT; Fri, 17 Nov 2023 14:14:21 +0300 (MSK) Received: from localhost (localhost.localdomain [127.0.0.1]) by mail.astralinux.ru (Postfix) with ESMTP id E0BA01866239; Fri, 17 Nov 2023 14:14:21 +0300 (MSK) X-Virus-Scanned: amavisd-new at astralinux.ru Received: from mail.astralinux.ru ([127.0.0.1]) by localhost (rbta-msk-vsrv-mail01.astralinux.ru [127.0.0.1]) (amavisd-new, port 10026) with ESMTP id fWXtdPalOdLf; Fri, 17 Nov 2023 14:14:21 +0300 (MSK) Received: from new-mail.astralinux.ru (unknown [10.177.185.103]) by mail.astralinux.ru (Postfix) with ESMTPS id 76A4918658FC; Fri, 17 Nov 2023 14:14:21 +0300 (MSK) Received: from [10.177.232.129] (unknown [10.177.232.129]) by new-mail.astralinux.ru (Postfix) with ESMTPA id 4SWvRw6K5nzhXb7; Fri, 17 Nov 2023 14:14:20 +0300 (MSK) Message-ID: Date: Fri, 17 Nov 2023 14:14:13 +0300 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.9.1 Subject: Re: [PATCH] cpufreq: scmi: process the result of devm_of_clk_add_hw_provider() Content-Language: en-US To: Sudeep Holla Cc: Cristian Marussi , "Rafael J. Wysocki" , Viresh Kumar , linux-arm-kernel@lists.infradead.org, linux-pm@vger.kernel.org, linux-kernel@vger.kernel.org, lvc-project@linuxtesting.org References: <20231117074911.14427-1-adiupina@astralinux.ru> From: =?UTF-8?B?0JDQu9C10LrRgdCw0L3QtNGA0LAg0JTRjtC/0LjQvdCw?= In-Reply-To: <20231117074911.14427-1-adiupina@astralinux.ru> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8BIT Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org I'm sorry, I forgot to add "return ret;" after calling the dev_err() function. Before I post the second version of the patch, please let me know what you think about this fix, keeping in mind what I wanted to add "return ret;" 17.11.2023 10:49, Alexandra Diupina пишет: > devm_of_clk_add_hw_provider() may return an errno, so > add a return value check > > Found by Linux Verification Center (linuxtesting.org) with SVACE. > > Fixes: 8410e7f3b31e ("cpufreq: scmi: Fix OPP addition failure with a dummy clock provider") > Signed-off-by: Alexandra Diupina > --- > drivers/cpufreq/scmi-cpufreq.c | 9 +++++++-- > 1 file changed, 7 insertions(+), 2 deletions(-) > > diff --git a/drivers/cpufreq/scmi-cpufreq.c b/drivers/cpufreq/scmi-cpufreq.c > index c8a7ccc42c16..4037945663bf 100644 > --- a/drivers/cpufreq/scmi-cpufreq.c > +++ b/drivers/cpufreq/scmi-cpufreq.c > @@ -334,8 +334,13 @@ static int scmi_cpufreq_probe(struct scmi_device *sdev) > > #ifdef CONFIG_COMMON_CLK > /* dummy clock provider as needed by OPP if clocks property is used */ > - if (of_property_present(dev->of_node, "#clock-cells")) > - devm_of_clk_add_hw_provider(dev, of_clk_hw_simple_get, NULL); > + if (of_property_present(dev->of_node, "#clock-cells")) { > + ret = devm_of_clk_add_hw_provider(dev, of_clk_hw_simple_get, NULL); > + if (ret) { > + dev_err(dev, "%s: registering clock provider failed, err: %d\n", > + __func__, ret); > + } > + } > #endif > > ret = cpufreq_register_driver(&scmi_cpufreq_driver); Regards, Alexandra Diupina