linux/drivers/char/hw_random
Xiongfeng Wang 19b7b85773 hwrng: geode - Fix PCI device refcount leak
[ Upstream commit 9f6ec8dc57 ]

for_each_pci_dev() is implemented by pci_get_device(). The comment of
pci_get_device() says that it will increase the reference count for the
returned pci_dev and also decrease the reference count for the input
pci_dev @from if it is not NULL.

If we break for_each_pci_dev() loop with pdev not NULL, we need to call
pci_dev_put() to decrease the reference count. We add a new struct
'amd_geode_priv' to record pointer of the pci_dev and membase, and then
add missing pci_dev_put() for the normal and error path.

Fixes: ef5d862734 ("[PATCH] Add Geode HW RNG driver")
Signed-off-by: Xiongfeng Wang <wangxiongfeng2@huawei.com>
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
Signed-off-by: Sasha Levin <sashal@kernel.org>
2022-12-31 13:32:37 +01:00
..
amd-rng.c hwrng: amd - Fix PCI device refcount leak 2022-12-31 13:32:37 +01:00
arm_smccc_trng.c hwrng: arm-smccc-trng - fix NO_ENTROPY handling 2022-08-19 18:39:35 +08:00
atmel-rng.c hwrng: atmel - remove extra line 2022-03-03 10:46:19 +12:00
ba431-rng.c
bcm2835-rng.c hwrng: bcm2835 - use hwrng_msleep() instead of cpu_relax() 2022-10-14 19:03:09 +08:00
cavium-rng-vf.c hwrng: cavium - fix NULL but dereferenced coccicheck error 2022-03-03 10:49:22 +12:00
cavium-rng.c
cctrng.c
cctrng.h
cn10k-rng.c hwrng: cn10k - Make check_rng_health() return an error code 2022-04-21 17:53:55 +08:00
core.c hwrng: core - start hwrng kthread also for untrusted sources 2022-09-30 13:59:12 +08:00
exynos-trng.c
geode-rng.c hwrng: geode - Fix PCI device refcount leak 2022-12-31 13:32:37 +01:00
hisi-rng.c
imx-rngc.c hwrng: imx-rngc - Moving IRQ handler registering after imx_rngc_irq_mask_clear() 2022-09-02 18:37:23 +08:00
ingenic-rng.c
ingenic-trng.c
intel-rng.c
iproc-rng200.c treewide: Replace GPLv2 boilerplate/reference with SPDX - gpl-2.0_30.RULE (part 1) 2022-06-10 14:51:35 +02:00
ixp4xx-rng.c
Kconfig hwrng: bcm2835: bcmbca: Replace ARCH_BCM_63XX with ARCH_BCMBCA 2022-07-10 19:11:00 -07:00
ks-sa-rng.c
Makefile hwrng: mpfs - add polarfire soc hwrng support 2022-04-15 16:34:28 +08:00
meson-rng.c
mpfs-rng.c hwrng: mpfs - add polarfire soc hwrng support 2022-04-15 16:34:28 +08:00
mtk-rng.c
mxc-rnga.c
n2-asm.S
n2-drv.c
n2rng.h
nomadik-rng.c hwrng: nomadik - Change clk_disable to clk_disable_unprepare 2022-03-14 14:45:44 +12:00
npcm-rng.c
octeon-rng.c
omap-rng.c
omap3-rom-rng.c hwrng: omap3-rom - fix using wrong clk_disable() in omap_rom_rng_runtime_resume() 2022-05-20 13:54:45 +08:00
optee-rng.c hwrng: optee - remove redundant initialization to variable rng_size 2022-04-29 13:44:58 +08:00
pasemi-rng.c
pic32-rng.c
powernv-rng.c powerpc/powernv: rename remaining rng powernv_ functions to pnv_ 2022-07-28 16:22:15 +10:00
pseries-rng.c
s390-trng.c s390 updates for 5.20 merge window 2022-08-06 17:05:21 -07:00
st-rng.c
stm32-rng.c
timeriomem-rng.c
via-rng.c hwrng: via - Fix comment typo 2022-07-22 16:22:04 +08:00
virtio-rng.c virtio-rng: make device ready before making request 2022-06-08 08:56:03 -04:00
xgene-rng.c
xiphera-trng.c