crypto: hisilicon/qm - fix device leak on QoS updates
Subsystems (3)
PATCH 1/1 crypto: hisilicon/qm - fix device leak on QoS updates
Make sure to drop the reference taken when looking up the PCI device on QoS updates.
--- drivers/crypto/hisilicon/qm.c | 3 +++ 1 file changed, 3 insertions(+)
drivers/crypto/hisilicon/qm.c +3 -0
@@ -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 ; }
Signature · 1 line
2.51.2
Quoted 21 lines · Johan Hovold
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 [email protected] # 6.2Cc Kai Ye <[email protected]>Signed-off-by Johan Hovold <[email protected]>--- drivers/crypto/hisilicon/qm.c | 3 +++ 1 file changed, 3 insertions(+)drivers/crypto/hisilicon/qm.c +1
-0@@ -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);
drivers/crypto/hisilicon/qm.c static ssize_t qm_get_qos_value(struct hisi_qm *qm, const char *buf, · line 3884
Quoted 10 lines
drivers/crypto/hisilicon/qm.c +2
-0return -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.
Quoted 6 lines · liulongfang
Quoted 2 lines · Johan Hovold
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 inqm_get_qos_value".
Ah, sorry for not noticing. I was still using rc5 as base and apparently forgot to check linux-next.
Johan