From: Myeonghun Pak <mhun512@gmail.com>
To: Srujana Challa <schalla@marvell.com>,
Bharat Bhushan <bbhushan2@marvell.com>,
Herbert Xu <herbert@gondor.apana.org.au>
Cc: "David S. Miller" <davem@davemloft.net>,
Lukasz Bartosik <lbartosik@marvell.com>,
linux-crypto@vger.kernel.org, linux-kernel@vger.kernel.org,
stable@vger.kernel.org, Ijae Kim <ae878000@gmail.com>
Subject: [PATCH] crypto: marvell/octeontx - clean up VF resources when DOWN fails
Date: Sun, 4 Oct 2026 00:26:34 -0400 [thread overview]
Message-ID: <20261004042634.1130247-1-mhun512@gmail.com> (raw)
A failed DOWN mailbox notification makes otx_cptvf_remove() skip all
local cleanup. The driver core still completes unbind and releases the
devm-allocated cptvf, leaving the raw IRQ handlers registered with that
object as their argument. The sysfs group, crypto device-table entry,
software queues and PCI resources also remain uncleaned.
Keep the notification error diagnostic, but run the existing local
cleanup regardless of the PF response. This removes both IRQ handlers
before killing the tasklet and releasing its resources, as on the
successful notification path.
This issue was identified during our ongoing static-analysis research
while reviewing kernel code.
Fixes: 10b4f09491bf ("crypto: marvell - add the Virtual Function driver for CPT")
Cc: stable@vger.kernel.org
Assisted-by: LLM
Co-developed-by: Ijae Kim <ae878000@gmail.com>
Signed-off-by: Ijae Kim <ae878000@gmail.com>
Signed-off-by: Myeonghun Pak <mhun512@gmail.com>
---
.../crypto/marvell/octeontx/otx_cptvf_main.c | 29 +++++++++----------
1 file changed, 14 insertions(+), 15 deletions(-)
diff --git a/drivers/crypto/marvell/octeontx/otx_cptvf_main.c b/drivers/crypto/marvell/octeontx/otx_cptvf_main.c
index 159c1d290a36..27d7b094c861 100644
--- a/drivers/crypto/marvell/octeontx/otx_cptvf_main.c
+++ b/drivers/crypto/marvell/octeontx/otx_cptvf_main.c
@@ -937,22 +937,21 @@ static void otx_cptvf_remove(struct pci_dev *pdev)
}
/* Convey DOWN to PF */
- if (otx_cptvf_send_vf_down(cptvf)) {
+ if (otx_cptvf_send_vf_down(cptvf))
dev_err(&pdev->dev, "PF not responding to DOWN msg\n");
- } else {
- sysfs_remove_group(&pdev->dev.kobj, &otx_cptvf_sysfs_group);
- otx_cpt_crypto_exit(pdev, THIS_MODULE, cptvf->vftype);
- cptvf_free_irq_affinity(cptvf, CPT_VF_INT_VEC_E_DONE);
- cptvf_free_irq_affinity(cptvf, CPT_VF_INT_VEC_E_MISC);
- free_irq(pci_irq_vector(pdev, CPT_VF_INT_VEC_E_DONE), cptvf);
- free_irq(pci_irq_vector(pdev, CPT_VF_INT_VEC_E_MISC), cptvf);
- cptvf_sw_cleanup(cptvf);
- pci_free_irq_vectors(cptvf->pdev);
- pci_iounmap(pdev, cptvf->reg_base);
- pci_release_regions(pdev);
- pci_disable_device(pdev);
- pci_set_drvdata(pdev, NULL);
- }
+
+ sysfs_remove_group(&pdev->dev.kobj, &otx_cptvf_sysfs_group);
+ otx_cpt_crypto_exit(pdev, THIS_MODULE, cptvf->vftype);
+ cptvf_free_irq_affinity(cptvf, CPT_VF_INT_VEC_E_DONE);
+ cptvf_free_irq_affinity(cptvf, CPT_VF_INT_VEC_E_MISC);
+ free_irq(pci_irq_vector(pdev, CPT_VF_INT_VEC_E_DONE), cptvf);
+ free_irq(pci_irq_vector(pdev, CPT_VF_INT_VEC_E_MISC), cptvf);
+ cptvf_sw_cleanup(cptvf);
+ pci_free_irq_vectors(cptvf->pdev);
+ pci_iounmap(pdev, cptvf->reg_base);
+ pci_release_regions(pdev);
+ pci_disable_device(pdev);
+ pci_set_drvdata(pdev, NULL);
}
/* Supported devices */
--
2.53.0
reply other threads:[~2026-10-04 4:26 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20261004042634.1130247-1-mhun512@gmail.com \
--to=mhun512@gmail.com \
--cc=ae878000@gmail.com \
--cc=bbhushan2@marvell.com \
--cc=davem@davemloft.net \
--cc=herbert@gondor.apana.org.au \
--cc=lbartosik@marvell.com \
--cc=linux-crypto@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=schalla@marvell.com \
--cc=stable@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®