[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <20231211171530.GP5817@kernel.org>
Date: Mon, 11 Dec 2023 17:15:30 +0000
From: Simon Horman <horms@...nel.org>
To: Srujana Challa <schalla@...vell.com>
Cc: herbert@...dor.apana.org.au, davem@...emloft.net, kuba@...nel.org,
linux-crypto@...r.kernel.org, netdev@...r.kernel.org,
linux-doc@...r.kernel.org, bbrezillon@...nel.org, arno@...isbad.org,
pabeni@...hat.com, edumazet@...gle.com, corbet@....net,
sgoutham@...vell.com, bbhushan2@...vell.com, jerinj@...vell.com,
sbhatta@...vell.com, hkelam@...vell.com, lcherian@...vell.com,
gakula@...vell.com, ndabilpuram@...vell.com
Subject: Re: [PATCH net-next v1 09/10] crypto/octeontx2: register error
interrupts for inline cptlf
On Mon, Dec 11, 2023 at 12:49:12PM +0530, Srujana Challa wrote:
> From: Nithin Dabilpuram <ndabilpuram@...vell.com>
>
> Register errors interrupts for inline cptlf attached to PF driver
> so that SMMU faults and other errors can be reported.
>
> Signed-off-by: Nithin Dabilpuram <ndabilpuram@...vell.com>
...
> diff --git a/drivers/crypto/marvell/octeontx2/otx2_cptpf_main.c b/drivers/crypto/marvell/octeontx2/otx2_cptpf_main.c
> index 7d44b54659bf..79afa3a451a7 100644
> --- a/drivers/crypto/marvell/octeontx2/otx2_cptpf_main.c
> +++ b/drivers/crypto/marvell/octeontx2/otx2_cptpf_main.c
> @@ -725,7 +725,7 @@ static int otx2_cptpf_probe(struct pci_dev *pdev,
> {
> struct device *dev = &pdev->dev;
> struct otx2_cptpf_dev *cptpf;
> - int err;
> + int err, num_vec;
>
> cptpf = devm_kzalloc(dev, sizeof(*cptpf), GFP_KERNEL);
> if (!cptpf)
> @@ -760,8 +760,11 @@ static int otx2_cptpf_probe(struct pci_dev *pdev,
> if (err)
> goto clear_drvdata;
>
> - err = pci_alloc_irq_vectors(pdev, RVU_PF_INT_VEC_CNT,
> - RVU_PF_INT_VEC_CNT, PCI_IRQ_MSIX);
> + num_vec = pci_msix_vec_count(cptpf->pdev);
> + if (num_vec <= 0)
> + goto clear_drvdata;
Hi Srujana and Nithin,
This goto will result in the function returning err.
However, err is 0 here. Perhaps it should be set to
a negative error value instead?
Flagged by Smatch.
> +
> + err = pci_alloc_irq_vectors(pdev, num_vec, num_vec, PCI_IRQ_MSIX);
> if (err < 0) {
> dev_err(dev, "Request for %d msix vectors failed\n",
> RVU_PF_INT_VEC_CNT);
...
Powered by blists - more mailing lists