Skip to content

Commit

Permalink
net: free RX queue structures
Browse files Browse the repository at this point in the history
Looks like commit e817f85 ("xdp: generic XDP handling of
xdp_rxq_info") replaced kvfree(dev->_rx) in free_netdev() with
a call to netif_free_rx_queues() which doesn't actually free
the rings?

While at it remove the unnecessary temporary variable.

Fixes: e817f85 ("xdp: generic XDP handling of xdp_rxq_info")
Signed-off-by: Jakub Kicinski <jakub.kicinski@netronome.com>
Reviewed-by: Simon Horman <simon.horman@netronome.com>
Acked-by: Jesper Dangaard Brouer <brouer@redhat.com>
Signed-off-by: Daniel Borkmann <daniel@iogearbox.net>
  • Loading branch information
Jakub Kicinski authored and Daniel Borkmann committed Jan 10, 2018
1 parent 141b52a commit 82aaff2
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions net/core/dev.c
Original file line number Diff line number Diff line change
Expand Up @@ -7653,16 +7653,15 @@ static int netif_alloc_rx_queues(struct net_device *dev)
static void netif_free_rx_queues(struct net_device *dev)
{
unsigned int i, count = dev->num_rx_queues;
struct netdev_rx_queue *rx;

/* netif_alloc_rx_queues alloc failed, resources have been unreg'ed */
if (!dev->_rx)
return;

rx = dev->_rx;

for (i = 0; i < count; i++)
xdp_rxq_info_unreg(&rx[i].xdp_rxq);
xdp_rxq_info_unreg(&dev->_rx[i].xdp_rxq);

kvfree(dev->_rx);
}

static void netdev_init_one_queue(struct net_device *dev,
Expand Down

0 comments on commit 82aaff2

Please sign in to comment.