]> git.droids-corp.org - dpdk.git/blobdiff - lib/librte_metrics/rte_metrics.c
net/sfc: check mbufs allocated using mempool API for Rx
[dpdk.git] / lib / librte_metrics / rte_metrics.c
index 038f58bf8456c6aeb3e6690a74a49fa9fec1a9da..99a96b651c5ef8123299cb867480f1b23c6c1b34 100644 (file)
@@ -96,6 +96,9 @@ rte_metrics_reg_names(const char * const *names, uint16_t cnt_names)
        /* Some sanity checks */
        if (cnt_names < 1 || names == NULL)
                return -EINVAL;
+       for (idx_name = 0; idx_name < cnt_names; idx_name++)
+               if (names[idx_name] == NULL)
+                       return -EINVAL;
 
        memzone = rte_memzone_lookup(RTE_METRICS_MEMZONE_NAME);
        if (memzone == NULL)