Re: [PATCH] hwrng: cavium: fix possible NULL pointer dereference

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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@xxxxxxxxx>
> ---
>  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@xxxxxxxxxxxxxxxxxxx>
Home Page: http://gondor.apana.org.au/~herbert/
PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt



[Index of Archives]     [Kernel]     [Gnu Classpath]     [Gnu Crypto]     [DM Crypt]     [Netfilter]     [Bugtraq]

  Powered by Linux