lkml.org 
[lkml]   [2020]   [Jun]   [19]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
    Patch in this message
    /
    From
    Subject[PATCH 5.7 141/376] octeontx2-pf: Fix error return code in otx2_probe()
    Date
    From: Wei Yongjun <weiyongjun1@huawei.com>

    [ Upstream commit 654cad8b6a17dcb00077070b27bc65873951a568 ]

    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>
    Signed-off-by: David S. Miller <davem@davemloft.net>
    Signed-off-by: Sasha Levin <sashal@kernel.org>
    ---
    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);
    --
    2.25.1


    \
     
     \ /
      Last update: 2020-06-19 17:25    [W:5.153 / U:0.140 seconds]
    ©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site