lkml.org 
[lkml]   [2020]   [Jan]   [24]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
    Patch in this message
    /
    From
    Subject[PATCH 4.19 346/639] net: ena: fix: Free napi resources when ena_up() fails
    Date
    From: Sameeh Jubran <sameehj@amazon.com>

    [ Upstream commit b287cdbd1cedfc9606682c6e02b58d00ff3a33ae ]

    ena_up() calls ena_init_napi() but does not call ena_del_napi() in
    case of failure. This causes a segmentation fault upon rmmod when
    netif_napi_del() is called. Fix this bug by calling ena_del_napi()
    before returning error from ena_up().

    Fixes: 1738cd3ed342 ("net: ena: Add a driver for Amazon Elastic Network Adapters (ENA)")
    Signed-off-by: Arthur Kiyanovski <akiyano@amazon.com>
    Signed-off-by: Sameeh Jubran <sameehj@amazon.com>
    Signed-off-by: David S. Miller <davem@davemloft.net>
    Signed-off-by: Sasha Levin <sashal@kernel.org>
    ---
    drivers/net/ethernet/amazon/ena/ena_netdev.c | 1 +
    1 file changed, 1 insertion(+)

    diff --git a/drivers/net/ethernet/amazon/ena/ena_netdev.c b/drivers/net/ethernet/amazon/ena/ena_netdev.c
    index e26c195fec83b..9afb19ebba580 100644
    --- a/drivers/net/ethernet/amazon/ena/ena_netdev.c
    +++ b/drivers/net/ethernet/amazon/ena/ena_netdev.c
    @@ -1800,6 +1800,7 @@ err_setup_rx:
    err_setup_tx:
    ena_free_io_irq(adapter);
    err_req_irq:
    + ena_del_napi(adapter);

    return rc;
    }
    --
    2.20.1


    \
     
     \ /
      Last update: 2020-01-24 12:20    [W:2.251 / U:3.788 seconds]
    ©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site