[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-ID: <1647573872-19278-1-git-send-email-baihaowen@meizu.com>
Date: Fri, 18 Mar 2022 11:24:32 +0800
From: Haowen Bai <baihaowen@...zu.com>
To: <mpm@...enic.com>, <herbert@...dor.apana.org.au>,
<sgoutham@...vell.com>
CC: <linux-crypto@...r.kernel.org>, <linux-kernel@...r.kernel.org>,
Haowen Bai <baihaowen@...zu.com>
Subject: [PATCH] hwrng: cavium: fix possible NULL pointer dereference
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");
return -EIO;
}
--
2.7.4
Powered by blists - more mailing lists