]> git.droids-corp.org - dpdk.git/blobdiff - app/test-pmd/tm.c
app/testpmd: fix allocation check in TM config
[dpdk.git] / app / test-pmd / tm.c
index b76335c1615ac69fa09d035c6f950d223c7b01e4..7231552a41c3408861f61726a7f7506cc6442d9e 100644 (file)
@@ -575,6 +575,10 @@ softport_tm_tc_node_add(portid_t port_id, struct tm_hierarchy *h,
                                tc_parent_node_id = h->pipe_node_id[i][j];
                                tnp.shared_shaper_id =
                                        (uint32_t *)calloc(1, sizeof(uint32_t));
+                               if (tnp.shared_shaper_id == NULL) {
+                                       printf("Shared shaper mem alloc err\n");
+                                       return -1;
+                               }
                                tnp.shared_shaper_id[0] = k;
                                pos = j + (i * PIPE_NODES_PER_SUBPORT);
                                h->tc_node_id[pos][k] =