mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Matthias Brugger <matthias.bgg@gmail.com>
To: Chengfeng Ye <cyeaa@connect.ust.hk>,
	mturquette@baylibre.com, sboyd@kernel.org
Cc: linux-kernel@vger.kernel.org, linux-mediatek@lists.infradead.org,
	linux-clk@vger.kernel.org, linux-arm-kernel@lists.infradead.org
Subject: Re: [PATCH] clk/mediatek: fix missing null-check for mt7622
Date: Fri, 19 Nov 2021 12:53:35 +0100	[thread overview]
Message-ID: <4dd739b0-bed7-d932-d56c-96b20143ee79@gmail.com> (raw)
In-Reply-To: <20211030140740.6947-1-cyeaa@connect.ust.hk>



On 30/10/2021 16:07, Chengfeng Ye wrote:
> The return pointer of mtk_alloc_clk_data could
> be null, adding null check for all the call sites.
> 
> Signed-off-by: Chengfeng Ye <cyeaa@connect.ust.hk>

This pattern is seen in nearly all MediaTek clock drivers. Is there any specific 
reason that you only fix the three?

Would you mind to check all of them and send the patches as a series instead of 
every patch one by one?

Regards,
Matthias

> ---
>   drivers/clk/mediatek/clk-mt7622.c | 6 ++++++
>   1 file changed, 6 insertions(+)
> 
> diff --git a/drivers/clk/mediatek/clk-mt7622.c b/drivers/clk/mediatek/clk-mt7622.c
> index ef5947e15c75..f16b3655ff76 100644
> --- a/drivers/clk/mediatek/clk-mt7622.c
> +++ b/drivers/clk/mediatek/clk-mt7622.c
> @@ -620,6 +620,8 @@ static int mtk_topckgen_init(struct platform_device *pdev)
>   		return PTR_ERR(base);
>   
>   	clk_data = mtk_alloc_clk_data(CLK_TOP_NR_CLK);
> +	if (!clk_data)
> +		return -ENOMEM;
>   
>   	mtk_clk_register_fixed_clks(top_fixed_clks, ARRAY_SIZE(top_fixed_clks),
>   				    clk_data);
> @@ -650,6 +652,8 @@ static int mtk_infrasys_init(struct platform_device *pdev)
>   	int r;
>   
>   	clk_data = mtk_alloc_clk_data(CLK_INFRA_NR_CLK);
> +	if (!clk_data)
> +		return -ENOMEM;
>   
>   	mtk_clk_register_gates(node, infra_clks, ARRAY_SIZE(infra_clks),
>   			       clk_data);
> @@ -700,6 +704,8 @@ static int mtk_pericfg_init(struct platform_device *pdev)
>   		return PTR_ERR(base);
>   
>   	clk_data = mtk_alloc_clk_data(CLK_PERI_NR_CLK);
> +	if (!clk_data)
> +		return -ENOMEM;
>   
>   	mtk_clk_register_gates(node, peri_clks, ARRAY_SIZE(peri_clks),
>   			       clk_data);
> 

      reply	other threads:[~2021-11-19 11:53 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-10-30 14:07 Chengfeng Ye
2021-11-19 11:53 ` Matthias Brugger [this message]

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=4dd739b0-bed7-d932-d56c-96b20143ee79@gmail.com \
    --to=matthias.bgg@gmail.com \
    --cc=cyeaa@connect.ust.hk \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-clk@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mediatek@lists.infradead.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

Powered by JetHome