bus/fslmc: fix iterating on a class type
[dpdk.git] / drivers / bus / fslmc / fslmc_bus.c
index afbd82e..ac46eb4 100644 (file)
@@ -603,6 +603,11 @@ fslmc_bus_dev_iterate(const void *start, const char *str,
        struct rte_dpaa2_device *dev;
        char *dup, *dev_name = NULL;
 
+       if (str == NULL) {
+               DPAA2_BUS_DEBUG("No device string");
+               return NULL;
+       }
+
        /* Expectation is that device would be name=device_name */
        if (strncmp(str, "name=", 5) != 0) {
                DPAA2_BUS_DEBUG("Invalid device string (%s)\n", str);