Skip to content

Commit

Permalink
net: ena: fix: Free napi resources when ena_up() fails
Browse files Browse the repository at this point in the history
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: 1738cd3 ("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>
  • Loading branch information
Sameeh Jubran authored and David S. Miller committed May 4, 2019
1 parent 8ee8ee7 commit b287cdb
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions drivers/net/ethernet/amazon/ena/ena_netdev.c
Original file line number Diff line number Diff line change
Expand Up @@ -1825,6 +1825,7 @@ static int ena_up(struct ena_adapter *adapter)
err_setup_tx:
ena_free_io_irq(adapter);
err_req_irq:
ena_del_napi(adapter);

return rc;
}
Expand Down

0 comments on commit b287cdb

Please sign in to comment.