* [PATCH net-next] octeontx2-pf: Fix error return code in otx2_probe()
@ 2020-04-27 12:11 Wei Yongjun
2020-05-01 3:28 ` David Miller
0 siblings, 1 reply; 2+ messages in thread
From: Wei Yongjun @ 2020-04-27 12:11 UTC (permalink / raw)
To: Sunil Goutham, Geetha sowjanya, Subbaraya Sundeep, hariprasad
Cc: Wei Yongjun, netdev, kernel-janitors
Fix to return negative error code -ENOMEM from the error handling
case instead of 0, as done elsewhere in this function.
Fixes: 5a6d7c9daef3 ("octeontx2-pf: Mailbox communication with AF")
Signed-off-by: Wei Yongjun <weiyongjun1@huawei.com>
---
drivers/net/ethernet/marvell/octeontx2/nic/otx2_pf.c | 8 ++++++--
1 file changed, 6 insertions(+), 2 deletions(-)
diff --git a/drivers/net/ethernet/marvell/octeontx2/nic/otx2_pf.c b/drivers/net/ethernet/marvell/octeontx2/nic/otx2_pf.c
index 411e5ea1031e..64786568af0d 100644
--- a/drivers/net/ethernet/marvell/octeontx2/nic/otx2_pf.c
+++ b/drivers/net/ethernet/marvell/octeontx2/nic/otx2_pf.c
@@ -1856,13 +1856,17 @@ static int otx2_probe(struct pci_dev *pdev, const struct pci_device_id *id)
num_vec = pci_msix_vec_count(pdev);
hw->irq_name = devm_kmalloc_array(&hw->pdev->dev, num_vec, NAME_SIZE,
GFP_KERNEL);
- if (!hw->irq_name)
+ if (!hw->irq_name) {
+ err = -ENOMEM;
goto err_free_netdev;
+ }
hw->affinity_mask = devm_kcalloc(&hw->pdev->dev, num_vec,
sizeof(cpumask_var_t), GFP_KERNEL);
- if (!hw->affinity_mask)
+ if (!hw->affinity_mask) {
+ err = -ENOMEM;
goto err_free_netdev;
+ }
/* Map CSRs */
pf->reg_base = pcim_iomap(pdev, PCI_CFG_REG_BAR_NUM, 0);
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH net-next] octeontx2-pf: Fix error return code in otx2_probe()
2020-04-27 12:11 [PATCH net-next] octeontx2-pf: Fix error return code in otx2_probe() Wei Yongjun
@ 2020-05-01 3:28 ` David Miller
0 siblings, 0 replies; 2+ messages in thread
From: David Miller @ 2020-05-01 3:28 UTC (permalink / raw)
To: weiyongjun1; +Cc: sgoutham, gakula, sbhatta, hkelam, netdev, kernel-janitors
From: Wei Yongjun <weiyongjun1@huawei.com>
Date: Mon, 27 Apr 2020 12:11:10 +0000
> Fix to return negative error code -ENOMEM from the error handling
> case instead of 0, as done elsewhere in this function.
>
> Fixes: 5a6d7c9daef3 ("octeontx2-pf: Mailbox communication with AF")
> Signed-off-by: Wei Yongjun <weiyongjun1@huawei.com>
Applied, thanks.
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2020-05-01 3:28 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-04-27 12:11 [PATCH net-next] octeontx2-pf: Fix error return code in otx2_probe() Wei Yongjun
2020-05-01 3:28 ` David Miller
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).