linux-stable/drivers/char/hw_random
Xiongfeng Wang aa96aff394 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>
2023-01-14 10:15:54 +01:00
..
amd-rng.c hwrng: amd - Fix PCI device refcount leak 2023-01-14 10:15:54 +01:00
atmel-rng.c hwrng: atmel - disable trng on failure path 2022-04-08 14:40:01 +02:00
ba431-rng.c
bcm2835-rng.c
cavium-rng-vf.c hwrng: cavium - Check health status while reading random data 2022-04-08 14:39:59 +02:00
cavium-rng.c hwrng: cavium - Check health status while reading random data 2022-04-08 14:39:59 +02:00
cctrng.c
cctrng.h
core.c random: pull add_hwgenerator_randomness() declaration into random.h 2022-05-30 09:33:36 +02:00
exynos-trng.c
geode-rng.c hwrng: geode - Fix PCI device refcount leak 2023-01-14 10:15:54 +01:00
hisi-rng.c
hisi-trng-v2.c
imx-rngc.c hwrng: imx-rngc - Moving IRQ handler registering after imx_rngc_irq_mask_clear() 2022-10-26 13:25:41 +02:00
ingenic-rng.c
ingenic-trng.c
intel-rng.c
iproc-rng200.c
ixp4xx-rng.c
Kconfig hwrng: cavium - HW_RANDOM_CAVIUM should depend on ARCH_THUNDER 2022-04-08 14:39:59 +02:00
ks-sa-rng.c
Makefile
meson-rng.c
mtk-rng.c hwrng: mtk - Force runtime pm ops for sleep ops 2021-11-18 14:04:06 +01:00
mxc-rnga.c
n2-asm.S
n2-drv.c
n2rng.h
nomadik-rng.c hwrng: nomadik - Change clk_disable to clk_disable_unprepare 2022-04-08 14:40:02 +02: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-06-09 10:21:17 +02:00
optee-rng.c
pasemi-rng.c
pic32-rng.c
powernv-rng.c
pseries-rng.c
s390-trng.c
st-rng.c
stm32-rng.c
timeriomem-rng.c
tx4939-rng.c
via-rng.c
virtio-rng.c
xgene-rng.c
xiphera-trng.c