From patchwork Tue Dec 5 15:12:20 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alexandra Diupina X-Patchwork-Id: 174074 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:bcd1:0:b0:403:3b70:6f57 with SMTP id r17csp3496856vqy; Tue, 5 Dec 2023 07:13:28 -0800 (PST) X-Google-Smtp-Source: AGHT+IHgRYUGACJg90IBF8/Qoi62ExGQhVrMFL/trntmLI2K5BXUF2FrOkURAL2OT4AmYSx1u1k/ X-Received: by 2002:a17:902:e548:b0:1d0:8383:742d with SMTP id n8-20020a170902e54800b001d08383742dmr3125676plf.37.1701789208735; Tue, 05 Dec 2023 07:13:28 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1701789208; cv=none; d=google.com; s=arc-20160816; b=sp8tIbxJG6guLd91gVaeDmy56GDI1e9ZEnNBqGXViJuBtYO6cqkXA2/OuVBInqLoBQ kBGSpwEBSykestLQZZ8EXETjh903BGA2KQtOI6OVkXimBwpfkKPGMjCPpQlvRgw8jRPR M769kEfsF2X20hGCaNnK9ori2XsB7H09//R/sJq0ivf/Pm9pu2ir+MbewlTeUvqhj7V/ 7AidX/nxcxQb4c4XwLg6b3aDY7ioqsZKzxYOJAI1NrCQYtCruDLljwL4lZOPenBNQCMu pwZxIwcux2/dYNCOP2Co6G6G7ZsZH1L/hpQqCDopUnzZmETCiBYXiyovLy5Nkxnab3D6 pzVw== 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 Received: from groat.vger.email (groat.vger.email. [2620:137:e000::3:5]) by mx.google.com with ESMTPS id r5-20020a632045000000b005c1b303c414si9843300pgm.625.2023.12.05.07.13.26 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 05 Dec 2023 07:13:28 -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 7DAE58051922; Tue, 5 Dec 2023 07:13:21 -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 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:21 -0800 (PST) X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1782796673381921423 X-GMAIL-MSGID: 1784455321311297228 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 --- v2: replace dev_err() with dev_err_probe() as 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-cpufreq.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 *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) + return dev_err_probe(dev, ret, "%s: registering clock provider failed\n", __func__); + } #endif ret = cpufreq_register_driver(&scmi_cpufreq_driver);