Received: by 2002:a05:7412:8d10:b0:f3:1519:9f41 with SMTP id bj16csp351344rdb; Tue, 5 Dec 2023 07:13:32 -0800 (PST) X-Google-Smtp-Source: AGHT+IF1O2zw5aue/gMLsc/T1uLDnmH3n98xa2E07W7+grjKbOwZDVNkkzs4NibhhXBRL2tjSy8P X-Received: by 2002:a05:6a00:1504:b0:6ce:2731:5f84 with SMTP id q4-20020a056a00150400b006ce27315f84mr1218267pfu.67.1701789211435; Tue, 05 Dec 2023 07:13:31 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1701789211; cv=none; d=google.com; s=arc-20160816; b=tm4dxLlj9lyi1/UeQCHYRqphR4srzQS9Qg0Wx30hdptc6BhKdsDVtA2wdZTWxfOCpF x75NHhwRe8onGXzm+SxI6cagztiNdIS37uShAw/IjH8WWnCkH2wKLOdYvX0fJp0tIWIW s1dBN882yvuPWBVefr//Ne3iBNqamUiSjHj4lA44cpPoerxTVdyT+H/7hsH4+3K6DeaI 9FjeFbvt9lvuOvsrmwEgH7PaGZDP9peKfyuWTkLAhrz52TTQ0A3JUnu/Ii8L8j6+XHJt 9bxvh46Q935hYhG7jYdbQBD1O6a97/tl8mhQOPsXwtBmbrJ6GBa4wh+h3gLrCuRhUBZ8 NnJw== 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 :references:in-reply-to:message-id:date:subject:cc:to:from; bh=pIOrcO0cgbivRIFUIMXLIFl1whFy0ZVPsGio15mILpk=; fh=lJV1ZI20ge+MdXnurdWhQ2QBeR6RKHc8EmfUIgocuRE=; b=usg7l6EzNN7J7yR1tNpFDUCmjY5Q7H1PW0JTXgH/Zg4cAwSpx1/ijIYLiMhIgSI+cT Z32yDwcKgPKBcpj2Vj6pr7yrowAsX3GEUuhhkHb10omO7vxC9wPbf8W4q6nwqEC3tkcu Ab8EUYR4FkuCkCbJ9tsAX668XI2u50RT5GdaSEDKsvFIlavdI2GeSURNtg2hpEevAJBi liTd3c87ksAqZVu6nSyXezaMVzBkyQzABS7kg1G7j/UNO9XEazEDtEoZPatjwADj6znq VB0R6+wmQs/BV6rhwaHZUGMfx+VM1p9KGDfJBrJ9pbZ9D4yJit0vh7BmRQTSeu7Pnu3l ZWMA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:5 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from groat.vger.email (groat.vger.email. [2620:137:e000::3:5]) by mx.google.com with ESMTPS id u9-20020a056a00158900b006cdfada31d0si8185269pfk.30.2023.12.05.07.13.30 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 05 Dec 2023 07:13:31 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:5 as permitted sender) client-ip=2620:137:e000::3:5; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:5 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by groat.vger.email (Postfix) with ESMTP id 41FEF8051A98; Tue, 5 Dec 2023 07:13:28 -0800 (PST) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.11 at groat.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1345944AbjLEPNM (ORCPT + 99 others); Tue, 5 Dec 2023 10:13:12 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:34316 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1345813AbjLEPNM (ORCPT ); Tue, 5 Dec 2023 10:13:12 -0500 Received: from mail.astralinux.ru (mail.astralinux.ru [217.74.38.119]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 3E616A9; Tue, 5 Dec 2023 07:13:16 -0800 (PST) Received: from localhost (localhost.localdomain [127.0.0.1]) by mail.astralinux.ru (Postfix) with ESMTP id DC2D9186C6E6; Tue, 5 Dec 2023 18:13:11 +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 9eDwiS4dHQIg; Tue, 5 Dec 2023 18:13:11 +0300 (MSK) Received: from localhost (localhost.localdomain [127.0.0.1]) by mail.astralinux.ru (Postfix) with ESMTP id 8F803186C626; Tue, 5 Dec 2023 18:13:11 +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 DwjuzGuN3um3; Tue, 5 Dec 2023 18:13:11 +0300 (MSK) Received: from rbta-msk-lt-302690.astralinux.ru (unknown [10.177.232.79]) by mail.astralinux.ru (Postfix) with ESMTPSA id B6151186C6DF; Tue, 5 Dec 2023 18:13:09 +0300 (MSK) From: Alexandra Diupina To: Sudeep Holla Cc: Alexandra Diupina , 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 Subject: [PATCH v2] cpufreq: scmi: process the result of devm_of_clk_add_hw_provider() Date: Tue, 5 Dec 2023 18:12:20 +0300 Message-Id: <20231205151220.18463-1-adiupina@astralinux.ru> X-Mailer: git-send-email 2.30.2 In-Reply-To: <2e919694-e124-4864-aa02-01d47495032b@wanadoo.fr> References: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-Spam-Status: No, score=-0.8 required=5.0 tests=HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on groat.vger.email Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (groat.vger.email [0.0.0.0]); Tue, 05 Dec 2023 07:13:28 -0800 (PST) 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 dumm= y clock provider") Signed-off-by: Alexandra Diupina --- v2: replace dev_err() with dev_err_probe() as=20 Christophe JAILLET suggested drivers/cpufreq/scmi-cpufreq.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/drivers/cpufreq/scmi-cpufreq.c b/drivers/cpufreq/scmi-cpufre= q.c index c8a7ccc42c16..4ee23f4ebf4a 100644 --- a/drivers/cpufreq/scmi-cpufreq.c +++ b/drivers/cpufreq/scmi-cpufreq.c @@ -334,8 +334,11 @@ static int scmi_cpufreq_probe(struct scmi_device *sd= ev) =20 #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 =3D devm_of_clk_add_hw_provider(dev, of_clk_hw_simple_get, NULL); + if (ret) + return dev_err_probe(dev, ret, "%s: registering clock provider failed= \n", __func__); + } #endif =20 ret =3D cpufreq_register_driver(&scmi_cpufreq_driver); --=20 2.30.2