net/ena: check memory BAR before initializing LLQ
[dpdk.git] / drivers / net / dpaa2 / dpaa2_mux.c
index 811f417..bd4596b 100644 (file)
@@ -68,6 +68,9 @@ rte_pmd_dpaa2_mux_flow_create(uint32_t dpdmux_id,
        int ret;
        static int i;
 
+       if (!pattern || !actions || !pattern[0] || !actions[0])
+               return NULL;
+
        /* Find the DPDMUX from dpdmux_id in our list */
        dpdmux_dev = get_dpdmux_from_id(dpdmux_id);
        if (!dpdmux_dev) {
@@ -92,7 +95,7 @@ rte_pmd_dpaa2_mux_flow_create(uint32_t dpdmux_id,
        mask_iova = (void *)((size_t)key_iova + DIST_PARAM_IOVA_SIZE);
 
        /* Currently taking only IP protocol as an extract type.
-        * This can be exended to other fields using pattern->type.
+        * This can be extended to other fields using pattern->type.
         */
        memset(&kg_cfg, 0, sizeof(struct dpkg_profile_cfg));
 
@@ -350,8 +353,7 @@ dpaa2_create_dpdmux_device(int vdev_fd __rte_unused,
        return 0;
 
 init_err:
-       if (dpdmux_dev)
-               rte_free(dpdmux_dev);
+       rte_free(dpdmux_dev);
 
        return -1;
 }