af_packet: fix crash on initialization failure
authorBruce Richardson <bruce.richardson@intel.com>
Tue, 16 Dec 2014 16:30:22 +0000 (16:30 +0000)
committerThomas Monjalon <thomas.monjalon@6wind.com>
Wed, 17 Dec 2014 00:04:06 +0000 (01:04 +0100)
commitb5af5c7967150fc541dba541c1ad8dc8aa642bff
tree5596179e3edfae54fd3d94db5c9b4e6379835c3b
parentc7ba32604d42a9cbc1d517b6d695d878785c2104
af_packet: fix crash on initialization failure

The cleanup code on error checks for *internals being NULL only after
using the pointer to perform other cleanup. Fix this by moving the
clean-up based on the pointer inside the check for NULL.

Signed-off-by: Bruce Richardson <bruce.richardson@intel.com>
lib/librte_pmd_af_packet/rte_eth_af_packet.c