linux/drivers/crypto/hisilicon
Miaoqian Lin 59b0afd01b crypto: hisilicon/qm - Fix device reference leak in qm_get_qos_value
The qm_get_qos_value() function calls bus_find_device_by_name() which
increases the device reference count, but fails to call put_device()
to balance the reference count and lead to a device reference leak.

Add put_device() calls in both the error path and success path to
properly balance the reference count.

Found via static analysis.

Fixes: 22d7a6c39c ("crypto: hisilicon/qm - add pci bdf number check")
Cc: stable@vger.kernel.org
Signed-off-by: Miaoqian Lin <linmq006@gmail.com>
Reviewed-by: Longfang Liu <liulongfang@huawei.com>
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
2025-11-06 14:29:49 +08:00
..
hpre This update includes the following changes: 2025-10-04 14:59:29 -07:00
sec crypto: hisilicon/sec - Use int type to store negative error codes 2025-09-13 12:11:06 +08:00
sec2 crypto: hisilicon - enable error reporting again 2025-09-20 20:21:04 +08:00
trng crypto: drivers - Switch back to struct platform_driver::remove() 2024-10-19 08:44:30 +08:00
zip crypto: hisilicon - enable error reporting again 2025-09-20 20:21:04 +08:00
debugfs.c crypto: hisilicon/qm - set NULL to qm->debug.qm_diff_regs 2025-09-20 20:21:04 +08:00
Kconfig crypto: hisilicon/hpre - Remove unused curve25519 kpp support 2025-09-06 14:45:49 -07:00
Makefile hwrng: histb - Move driver to drivers/char/hw_random/histb-rng.c 2023-05-12 18:48:01 +08:00
qm_common.h crypto: hisilicon/qm - simplify the status of qm 2023-12-01 18:03:26 +08:00
qm.c crypto: hisilicon/qm - Fix device reference leak in qm_get_qos_value 2025-11-06 14:29:49 +08:00
sgl.c crypto: hisilicon - Use fine grained DMA mapping direction 2025-06-23 17:00:27 +08:00