net/dpaa: fix potential memory leak
authorYong Wang <wang.yong19@zte.com.cn>
Thu, 18 Jan 2018 11:48:56 +0000 (06:48 -0500)
committerFerruh Yigit <ferruh.yigit@intel.com>
Sun, 21 Jan 2018 14:51:52 +0000 (15:51 +0100)
commit0ff76833f8b54d61c2795d1710fb60aa499469bf
tree5a030bd04eb5952be9bd0e0f7820ec1628b15dc0
parent7f3ef71bfda983aeb68cd1e36c3089ff39df587e
net/dpaa: fix potential memory leak

There are several func calls to rte_zmalloc() which don't do null
pointer check on the return value. And before return, the memory is not
freed. Fix it by adding null pointer check and rte_free().

Fixes: 37f9b54bd3cf ("net/dpaa: support Tx and Rx queue setup")
Fixes: 62f53995caaf ("net/dpaa: add frame count based tail drop with CGR")
Cc: stable@dpdk.org
Signed-off-by: Yong Wang <wang.yong19@zte.com.cn>
Reviewed-by: Shreyansh Jain <shreyansh.jain@nxp.com>
drivers/net/dpaa/dpaa_ethdev.c