[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <0df30bbf-3b7e-ed20-e316-41192bf3cc2b@linaro.org>
Date: Tue, 22 Nov 2022 08:42:40 +0100
From: Neil Armstrong <neil.armstrong@...aro.org>
To: Jiasheng Jiang <jiasheng@...as.ac.cn>, clabbe@...libre.com,
herbert@...dor.apana.org.au, davem@...emloft.net
Cc: linux-crypto@...r.kernel.org, linux-amlogic@...ts.infradead.org,
linux-kernel@...r.kernel.org
Subject: Re: [PATCH] crypto: amlogic - Add check for devm_kcalloc
On 22/11/2022 07:22, Jiasheng Jiang wrote:
> As the devm_kcalloc may return NULL pointer,
> it should be better to add check for the return
> value, as same as the others.
>
> Fixes: 48fe583fe541 ("crypto: amlogic - Add crypto accelerator for amlogic GXL")
> Signed-off-by: Jiasheng Jiang <jiasheng@...as.ac.cn>
> ---
> drivers/crypto/amlogic/amlogic-gxl-core.c | 3 +++
> 1 file changed, 3 insertions(+)
>
> diff --git a/drivers/crypto/amlogic/amlogic-gxl-core.c b/drivers/crypto/amlogic/amlogic-gxl-core.c
> index 6e7ae896717c..b243d6382664 100644
> --- a/drivers/crypto/amlogic/amlogic-gxl-core.c
> +++ b/drivers/crypto/amlogic/amlogic-gxl-core.c
> @@ -238,6 +238,9 @@ static int meson_crypto_probe(struct platform_device *pdev)
> }
>
> mc->irqs = devm_kcalloc(mc->dev, MAXFLOW, sizeof(int), GFP_KERNEL);
> + if (!mc->irqs)
> + return -ENOMEM;
> +
> for (i = 0; i < MAXFLOW; i++) {
> mc->irqs[i] = platform_get_irq(pdev, i);
> if (mc->irqs[i] < 0)
Reviewed-by: Neil Armstrong <neil.armstrong@...aro.org>
Powered by blists - more mailing lists