app/testpmd: fix memory failure handling for i40e DDP
authorKalesh AP <kalesh-anakkur.purayil@broadcom.com>
Fri, 8 May 2020 04:50:24 +0000 (10:20 +0530)
committerFerruh Yigit <ferruh.yigit@intel.com>
Mon, 11 May 2020 20:27:39 +0000 (22:27 +0200)
commit489bdbbfc269c819ec679605d1f0e8ad058789f4
tree491c4ece82202bab9946187a14630512181015ba
parentf002ee9c8e26d2d7f0cda418d2565adc696584cf
app/testpmd: fix memory failure handling for i40e DDP

In cmd_ddp_get_list_parsed(), elements of "p_list" are accessed
even after the memory allocation for "p_list" fails.

With this patch, this null pointer dereference is avoided as we
return when there is malloc failure.

Fixes: e088907bb851 ("app/testpmd: add command for getting loaded DDP profiles")
Cc: stable@dpdk.org
Signed-off-by: Kalesh AP <kalesh-anakkur.purayil@broadcom.com>
Acked-by: Bernard Iremonger <bernard.iremonger@intel.com>
app/test-pmd/cmdline.c