* [PATCH] crypto: hisilicon/qm - fix device leak on QoS updates
@ 2025-11-21 11:11 Johan Hovold
2025-11-24 2:03 ` liulongfang
0 siblings, 1 reply; 3+ messages in thread
From: Johan Hovold @ 2025-11-21 11:11 UTC (permalink / raw)
To: Weili Qian, Zhou Wang, Herbert Xu, David S . Miller
Cc: Kai Ye, linux-crypto, linux-kernel, Johan Hovold, stable
Make sure to drop the reference taken when looking up the PCI device on
QoS updates.
Fixes: 22d7a6c39cab ("crypto: hisilicon/qm - add pci bdf number check")
Cc: stable@vger.kernel.org # 6.2
Cc: Kai Ye <yekai13@huawei.com>
Signed-off-by: Johan Hovold <johan@kernel.org>
---
drivers/crypto/hisilicon/qm.c | 3 +++
1 file changed, 3 insertions(+)
diff --git a/drivers/crypto/hisilicon/qm.c b/drivers/crypto/hisilicon/qm.c
index a5b96adf2d1e..ef6fdcc3dbcb 100644
--- a/drivers/crypto/hisilicon/qm.c
+++ b/drivers/crypto/hisilicon/qm.c
@@ -3871,11 +3871,14 @@ static ssize_t qm_get_qos_value(struct hisi_qm *qm, const char *buf,
pdev = container_of(dev, struct pci_dev, dev);
if (pci_physfn(pdev) != qm->pdev) {
pci_err(qm->pdev, "the pdev input does not match the pf!\n");
+ put_device(dev);
return -EINVAL;
}
*fun_index = pdev->devfn;
+ put_device(dev);
+
return 0;
}
--
2.51.2
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [PATCH] crypto: hisilicon/qm - fix device leak on QoS updates
2025-11-21 11:11 [PATCH] crypto: hisilicon/qm - fix device leak on QoS updates Johan Hovold
@ 2025-11-24 2:03 ` liulongfang
2025-11-24 10:07 ` Johan Hovold
0 siblings, 1 reply; 3+ messages in thread
From: liulongfang @ 2025-11-24 2:03 UTC (permalink / raw)
To: Johan Hovold, Weili Qian, Zhou Wang, Herbert Xu, David S . Miller
Cc: Kai Ye, linux-crypto, linux-kernel, stable
On 2025/11/21 19:11, Johan Hovold wrote:
> Make sure to drop the reference taken when looking up the PCI device on
> QoS updates.
>
> Fixes: 22d7a6c39cab ("crypto: hisilicon/qm - add pci bdf number check")
> Cc: stable@vger.kernel.org # 6.2
> Cc: Kai Ye <yekai13@huawei.com>
> Signed-off-by: Johan Hovold <johan@kernel.org>
> ---
> drivers/crypto/hisilicon/qm.c | 3 +++
> 1 file changed, 3 insertions(+)
>
> diff --git a/drivers/crypto/hisilicon/qm.c b/drivers/crypto/hisilicon/qm.c
> index a5b96adf2d1e..ef6fdcc3dbcb 100644
> --- a/drivers/crypto/hisilicon/qm.c
> +++ b/drivers/crypto/hisilicon/qm.c
> @@ -3871,11 +3871,14 @@ static ssize_t qm_get_qos_value(struct hisi_qm *qm, const char *buf,
> pdev = container_of(dev, struct pci_dev, dev);
> if (pci_physfn(pdev) != qm->pdev) {
> pci_err(qm->pdev, "the pdev input does not match the pf!\n");
> + put_device(dev);
> return -EINVAL;
> }
>
> *fun_index = pdev->devfn;
>
> + put_device(dev);
> +
> return 0;
> }
>
>
This issue has already been fixed by the following patch:
"[PATCH] crypto: hisilicon/qm - Fix device reference leak in qm_get_qos_value".
Thanks.
Longfang.
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH] crypto: hisilicon/qm - fix device leak on QoS updates
2025-11-24 2:03 ` liulongfang
@ 2025-11-24 10:07 ` Johan Hovold
0 siblings, 0 replies; 3+ messages in thread
From: Johan Hovold @ 2025-11-24 10:07 UTC (permalink / raw)
To: liulongfang
Cc: Weili Qian, Zhou Wang, Herbert Xu, David S . Miller, Kai Ye,
linux-crypto, linux-kernel, stable
On Mon, Nov 24, 2025 at 10:03:03AM +0800, liulongfang wrote:
> On 2025/11/21 19:11, Johan Hovold wrote:
> > Make sure to drop the reference taken when looking up the PCI device on
> > QoS updates.
> This issue has already been fixed by the following patch:
> "[PATCH] crypto: hisilicon/qm - Fix device reference leak in qm_get_qos_value".
Ah, sorry for not noticing. I was still using rc5 as base and apparently
forgot to check linux-next.
Johan
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2025-11-24 10:07 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-11-21 11:11 [PATCH] crypto: hisilicon/qm - fix device leak on QoS updates Johan Hovold
2025-11-24 2:03 ` liulongfang
2025-11-24 10:07 ` Johan Hovold
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).