* [PATCH] hwrng: cavium: fix possible NULL pointer dereference
@ 2022-03-18 3:24 Haowen Bai
2022-03-19 1:55 ` Herbert Xu
0 siblings, 1 reply; 3+ messages in thread
From: Haowen Bai @ 2022-03-18 3:24 UTC (permalink / raw)
To: mpm, herbert, sgoutham; +Cc: linux-crypto, linux-kernel, Haowen Bai
pdev is NULL but dereference to pdev->dev
Signed-off-by: Haowen Bai <baihaowen@meizu.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");
return -EIO;
}
--
2.7.4
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH] hwrng: cavium: fix possible NULL pointer dereference
2022-03-18 3:24 [PATCH] hwrng: cavium: fix possible NULL pointer dereference Haowen Bai
@ 2022-03-19 1:55 ` Herbert Xu
0 siblings, 0 replies; 3+ messages in thread
From: Herbert Xu @ 2022-03-19 1:55 UTC (permalink / raw)
To: Haowen Bai; +Cc: mpm, sgoutham, linux-crypto, linux-kernel
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@meizu.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@gondor.apana.org.au>
Home Page: http://gondor.apana.org.au/~herbert/
PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt
^ permalink raw reply [flat|nested] 3+ messages in thread
* [PATCH] hwrng: cavium: fix possible NULL pointer dereference
@ 2022-03-21 1:28 Haowen Bai
0 siblings, 0 replies; 3+ messages in thread
From: Haowen Bai @ 2022-03-21 1:28 UTC (permalink / raw)
To: mpm, herbert, sgoutham; +Cc: linux-crypto, linux-kernel, Haowen Bai
pdev is NULL but dereference to pdev->dev
Signed-off-by: Haowen Bai <baihaowen@meizu.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");
+ pr_err("Cannot find RNG PF device\n");
return -EIO;
}
--
2.7.4
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2022-03-21 1:28 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-03-18 3:24 [PATCH] hwrng: cavium: fix possible NULL pointer dereference Haowen Bai
2022-03-19 1:55 ` Herbert Xu
2022-03-21 1:28 Haowen Bai
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®