[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <YjU3++JNa+XMt/0c@gondor.apana.org.au>
Date: Sat, 19 Mar 2022 13:55:07 +1200
From: Herbert Xu <herbert@...dor.apana.org.au>
To: Haowen Bai <baihaowen@...zu.com>
Cc: mpm@...enic.com, sgoutham@...vell.com,
linux-crypto@...r.kernel.org, linux-kernel@...r.kernel.org
Subject: Re: [PATCH] hwrng: cavium: fix possible NULL pointer dereference
On Fri, Mar 18, 2022 at 11:24:32AM +0800, Haowen Bai wrote:
> pdev is NULL but dereference to pdev->dev
>
> Signed-off-by: Haowen Bai <baihaowen@...zu.com>
> ---
> drivers/char/hw_random/cavium-rng-vf.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/char/hw_random/cavium-rng-vf.c b/drivers/char/hw_random/cavium-rng-vf.c
> index 6f66919..bffcb01 100644
> --- a/drivers/char/hw_random/cavium-rng-vf.c
> +++ b/drivers/char/hw_random/cavium-rng-vf.c
> @@ -179,7 +179,7 @@ static int cavium_map_pf_regs(struct cavium_rng *rng)
> pdev = pci_get_device(PCI_VENDOR_ID_CAVIUM,
> PCI_DEVID_CAVIUM_RNG_PF, NULL);
> if (!pdev) {
> - dev_err(&pdev->dev, "Cannot find RNG PF device\n");
> + printk(KERN_ERR "Cannot find RNG PF device\n");
Please use pr_err.
Thanks,
--
Email: Herbert Xu <herbert@...dor.apana.org.au>
Home Page: http://gondor.apana.org.au/~herbert/
PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt
Powered by blists - more mailing lists