bus/fslmc: fix find device start condition
authorGaetan Rivet <gaetan.rivet@6wind.com>
Thu, 22 Mar 2018 10:28:44 +0000 (11:28 +0100)
committerThomas Monjalon <thomas@monjalon.net>
Wed, 4 Apr 2018 22:45:21 +0000 (00:45 +0200)
If start is set and a device before it matches the data,
this device is returned.

Fixes: c7fe1eea8a74 ("bus: simplify finding starting point")
Cc: stable@dpdk.org
Signed-off-by: Gaetan Rivet <gaetan.rivet@6wind.com>
Acked-by: Shreyansh Jain <shreyansh.jain@nxp.com>
drivers/bus/fslmc/fslmc_bus.c

index 4d29b53..d6806df 100644 (file)
@@ -321,8 +321,9 @@ rte_fslmc_find_device(const struct rte_device *start, rte_dev_cmp_t cmp,
        struct rte_dpaa2_device *dev;
 
        TAILQ_FOREACH(dev, &rte_fslmc_bus.device_list, next) {
-               if (start && &dev->device == start) {
-                       start = NULL;  /* starting point found */
+               if (start != NULL) {
+                       if (&dev->device == start)
+                               start = NULL;  /* starting point found */
                        continue;
                }