mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Lukasz Luba <lukasz.luba@arm.com>
To: Krzysztof Kozlowski <krzysztof.kozlowski@canonical.com>
Cc: linux-pm@vger.kernel.org, linux-samsung-soc@vger.kernel.org,
	linux-kernel@vger.kernel.org,
	linux-arm-kernel@lists.infradead.org
Subject: Re: [PATCH] memory: samsung: exynos5422-dmc: handle clk_set_parent() failure
Date: Wed, 7 Apr 2021 16:56:00 +0100	[thread overview]
Message-ID: <1906533a-e86a-10fe-5bc3-4600af98d579@arm.com> (raw)
In-Reply-To: <20210407154535.70756-1-krzysztof.kozlowski@canonical.com>

Hi Krzysztof,

On 4/7/21 4:45 PM, Krzysztof Kozlowski wrote:
> clk_set_parent() can fail and ignoring such case could lead to invalid
> clock setup for given frequency.
> 
> Addresses-Coverity: Unchecked return value
> Fixes: 6e7674c3c6df ("memory: Add DMC driver for Exynos5422")
> Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@canonical.com>
> ---
>   drivers/memory/samsung/exynos5422-dmc.c | 4 +++-
>   1 file changed, 3 insertions(+), 1 deletion(-)
> 
> diff --git a/drivers/memory/samsung/exynos5422-dmc.c b/drivers/memory/samsung/exynos5422-dmc.c
> index 56f6e65d40cd..9c8318923ed0 100644
> --- a/drivers/memory/samsung/exynos5422-dmc.c
> +++ b/drivers/memory/samsung/exynos5422-dmc.c
> @@ -1293,7 +1293,9 @@ static int exynos5_dmc_init_clks(struct exynos5_dmc *dmc)
>   
>   	dmc->curr_volt = target_volt;
>   
> -	clk_set_parent(dmc->mout_mx_mspll_ccore, dmc->mout_spll);
> +	ret = clk_set_parent(dmc->mout_mx_mspll_ccore, dmc->mout_spll);
> +	if (ret)
> +		return ret;
>   
>   	clk_prepare_enable(dmc->fout_bpll);
>   	clk_prepare_enable(dmc->mout_bpll);
> 

Thanks for running these tests and for the patch.
I've checked how many many places this function is used in the kernel
and return is ignored - in a lot of places...

This patch LGTM.

Reviewed-by: Lukasz Luba <lukasz.luba@arm.com>

Regards,
Lukasz

  reply	other threads:[~2021-04-07 15:56 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-04-07 15:45 Krzysztof Kozlowski
2021-04-07 15:56 ` Lukasz Luba [this message]
2021-04-13 14:58 ` 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=1906533a-e86a-10fe-5bc3-4600af98d579@arm.com \
    --to=lukasz.luba@arm.com \
    --cc=krzysztof.kozlowski@canonical.com \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-pm@vger.kernel.org \
    --cc=linux-samsung-soc@vger.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

all inboxes | Powered by JetHome®