Received: by 2002:a05:7412:b130:b0:e2:908c:2ebd with SMTP id az48csp346762rdb; Thu, 16 Nov 2023 23:49:56 -0800 (PST) X-Google-Smtp-Source: AGHT+IEkn7636GnLSubPCioV8ZtvCZEEu/hUKjxLPAWAW4rwyRYi3KNiKGwtGV8u1j91CpNRVR0T X-Received: by 2002:a17:902:aa4a:b0:1cc:5612:85 with SMTP id c10-20020a170902aa4a00b001cc56120085mr10086524plr.45.1700207395787; Thu, 16 Nov 2023 23:49:55 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1700207395; cv=none; d=google.com; s=arc-20160816; b=gvch/aOTbTBW+W0nlQodUP7ff/EYA+SX/J9HrSiZ6vMbUnicd0sHSC5GwbT8v8O8gd tshxinxQnSTHhogtYdcGDmEQQjUzkTJVjPMnPCmfOXN8Unh29PLcXa8EI+VpWBt7SfHa 0WmZspUZtw7bdbhsF5qNqcDCbJmg4d20AYUn81z53ggC38SuaL86uRdBEytbOmyQBifN uYLuikd8Y/vXHWT/IT4QvgFAAVk7slkiuI0KKxJ/ZysgNNDmExb0WMiEnb/yxDM+TxR2 Hou2WJjHhS3VmM10BQ9E+xlg/QwZ6znkkfLvYyo5K74eY9SRxYJ3+Nv9Hm7wDQ8KsS3F q5QQ== 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 :message-id:date:subject:cc:to:from; bh=1VQni7ilcGOXaOAqgJKlmRsQMtXxcIOQI9U7eVJbt7s=; fh=lJV1ZI20ge+MdXnurdWhQ2QBeR6RKHc8EmfUIgocuRE=; b=i7kVzdgJd2XqAWqfwN1uVgYnSZprPPsg2KcQIOnDa2FAUYOQjbO69uAcZdzkZdsz71 P1GJVxLuHbVqXQ0uSAmausPSZU5Wc7WQMQv3r1FJ3T2pepRt675Uz23guvefIxlm61HK hVvoHhBE5GwDh3Jq5IVr7LaqMx3uK18Co++joGaLdZ1uMLjdgxjvhpH0405SgIZyizEF 0MRJa4ghwjjGDID/4VXBmcIlPUi2/GIKJuU5VkVFPCvdxKjl6dh1gdBDht85aUlGXBjS WRNZw+gKleP0HFrj8uoQLHJL5k/oCy20/A2JsYh5hsX4eMJQBDdVdXpKIKWU4kTrpIA6 FC+Q== 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 jg12-20020a17090326cc00b001c20db25108si1227262plb.41.2023.11.16.23.49.54 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 16 Nov 2023 23:49:55 -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 CF03A802850E; Thu, 16 Nov 2023 23:49:52 -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 S230359AbjKQHtn (ORCPT + 99 others); Fri, 17 Nov 2023 02:49:43 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:49864 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229952AbjKQHtm (ORCPT ); Fri, 17 Nov 2023 02:49:42 -0500 Received: from mail.astralinux.ru (mail.astralinux.ru [217.74.38.119]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 5F314D52; Thu, 16 Nov 2023 23:49:37 -0800 (PST) Received: from localhost (localhost.localdomain [127.0.0.1]) by mail.astralinux.ru (Postfix) with ESMTP id 9C5A418687BF; Fri, 17 Nov 2023 10:49:33 +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 gby14e2W0CAp; Fri, 17 Nov 2023 10:49:33 +0300 (MSK) Received: from localhost (localhost.localdomain [127.0.0.1]) by mail.astralinux.ru (Postfix) with ESMTP id 504581868DBC; Fri, 17 Nov 2023 10:49:33 +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 EVOAij3UbOAZ; Fri, 17 Nov 2023 10:49:33 +0300 (MSK) Received: from rbta-msk-lt-302690.astralinux.ru (unknown [10.177.232.129]) by mail.astralinux.ru (Postfix) with ESMTPSA id 1C00D18687BF; Fri, 17 Nov 2023 10:49:31 +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] cpufreq: scmi: process the result of devm_of_clk_add_hw_provider() Date: Fri, 17 Nov 2023 10:49:11 +0300 Message-Id: <20231117074911.14427-1-adiupina@astralinux.ru> X-Mailer: git-send-email 2.30.2 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]); Thu, 16 Nov 2023 23:49:53 -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 --- 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-cpufre= q.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 *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) { + dev_err(dev, "%s: registering clock provider failed, err: %d\n", + __func__, ret); + } + } #endif =20 ret =3D cpufreq_register_driver(&scmi_cpufreq_driver); --=20 2.30.2