af_packet: refactor error handling to avoid NULL pointer dereference
authorJohn W. Linville <linville@tuxdriver.com>
Thu, 27 Aug 2015 17:17:13 +0000 (13:17 -0400)
committerThomas Monjalon <thomas.monjalon@6wind.com>
Tue, 20 Oct 2015 15:58:10 +0000 (17:58 +0200)
commit43254a336780a7d21c525097794a70a21a7fa2c4
tree90ef202616d5622d4ecc92e47a146e048e8f2407
parentba92d511ddacf863fafaaa14c0577f30ee57d092
af_packet: refactor error handling to avoid NULL pointer dereference

Coverity CID # 13321

Checking *internals != NULL before accessing req is not good enough,
because **internals is a function argument and the function doesn't
really know what is passed-in.  We can close our eyes and ignore the
warning on the basis of controlling all the calling code, or we can
refactor the error exit to avoid the issue entirely...

Signed-off-by: John W. Linville <linville@tuxdriver.com>
Acked-by: Neil Horman <nhorman@tuxdriver.com>
drivers/net/af_packet/rte_eth_af_packet.c