e1000: do not release queue on alloc error
authorKonstantin Ananyev <konstantin.ananyev@intel.com>
Mon, 9 Jun 2014 17:26:14 +0000 (18:26 +0100)
committerThomas Monjalon <thomas.monjalon@6wind.com>
Tue, 10 Jun 2014 22:29:36 +0000 (00:29 +0200)
commitc6c79fa425f12fbb7ebb57b53bd83dd00deeaf3e
tree0086b1399c221b66ef7a4330cdaf544b357bbacc
parent3031749c2df04a63cdcef186dcce3781e61436e8
e1000: do not release queue on alloc error

If igb_alloc_rx_queue_mbufs() would fail to allocate an mbuf for RX queue,
it calls igb_rx_queue_release(rxq).
That causes rxq to be silently freed, without updating
dev->data->rx_queues[].
So any further reference to it will trigger the SIGSEGV.
Same thing in em PMD too.

To fix: igb_alloc_rx_queue_mbufs() should just return an error to the
caller and let upper layer to deal with the probem.
That's what ixgbe PMD is doing right now.

Signed-off-by: Konstantin Ananyev <konstantin.ananyev@intel.com>
Acked-by: Thomas Monjalon <thomas.monjalon@6wind.com>
lib/librte_pmd_e1000/em_rxtx.c
lib/librte_pmd_e1000/igb_rxtx.c