ethdev: fix crash if malloc of user callback fails
authorStephen Hemminger <stephen@networkplumber.org>
Thu, 16 Jul 2015 23:47:23 +0000 (16:47 -0700)
committerThomas Monjalon <thomas.monjalon@6wind.com>
Wed, 22 Jul 2015 13:57:57 +0000 (15:57 +0200)
commitac2f69c9fc222cdda0235731223d40a93388ed3d
treeac7735b46ca06cda9cc83c75e15b5699d0b63d86
parent31c79ec582f3ed1e1a48b36db0d052cc366c527e
ethdev: fix crash if malloc of user callback fails

Found by coccinelle script.
If rte_zmalloc() failed in rte_eth_dev_callback_register
then NULL pointer would be dereferenced.

Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
Acked-by: Thomas Monjalon <thomas.monjalon@6wind.com>
[Thomas: restore pointer comparison style]
lib/librte_ether/rte_ethdev.c