Linux-Samsung-soc Archive mirror
 help / color / mirror / Atom feed
From: Aleksandr Aprelkov <aaprelkov@usergate.com>
To: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
Cc: Aleksandr Aprelkov <aaprelkov@usergate.com>,Michael Turquette
	<mturquette@baylibre.com>,Stephen Boyd
	<sboyd@kernel.org>,<linux-kernel@vger.kernel.org>,<linux-samsung-soc@vger.kernel.org>,<linux-clk@vger.kernel.org>,<lvc-project@linuxtesting.org>
Subject: [PATCH] clk: s2mps11: Check of_clk_add_hw_provider() result
Date: Mon, 1 Apr 2024 17:38:08 +0700	[thread overview]
Message-ID: <20240401103808.617463-1-aaprelkov@usergate.com> (raw)

There is no check if error occurs in clock provider registration.

Found by Linux Verification Center (linuxtesting.org) with SVACE.

Fixes: b228fad50c00 ("clk: s2mps11: Migrate to clk_hw based OF and registration APIs")
Signed-off-by: Aleksandr Aprelkov <aaprelkov@usergate.com>
---
 drivers/clk/clk-s2mps11.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/drivers/clk/clk-s2mps11.c b/drivers/clk/clk-s2mps11.c
index 38c456540d1b..f9ce413b6c02 100644
--- a/drivers/clk/clk-s2mps11.c
+++ b/drivers/clk/clk-s2mps11.c
@@ -187,8 +187,10 @@ static int s2mps11_clk_probe(struct platform_device *pdev)
 	}
 
 	clk_data->num = S2MPS11_CLKS_NUM;
-	of_clk_add_hw_provider(s2mps11_clks->clk_np, of_clk_hw_onecell_get,
+	ret = of_clk_add_hw_provider(s2mps11_clks->clk_np, of_clk_hw_onecell_get,
 			       clk_data);
+	if (ret < 0)
+		goto err_reg;
 
 	platform_set_drvdata(pdev, s2mps11_clks);
 
-- 
2.34.1


             reply	other threads:[~2024-04-01 10:38 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-04-01 10:38 Aleksandr Aprelkov [this message]
2024-04-01 12:06 ` [PATCH] clk: s2mps11: Check of_clk_add_hw_provider() result Christophe JAILLET
2024-04-01 14:40 ` Krzysztof Kozlowski

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20240401103808.617463-1-aaprelkov@usergate.com \
    --to=aaprelkov@usergate.com \
    --cc=krzysztof.kozlowski@linaro.org \
    --cc=linux-clk@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-samsung-soc@vger.kernel.org \
    --cc=lvc-project@linuxtesting.org \
    --cc=mturquette@baylibre.com \
    --cc=sboyd@kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).