From: Gaetan Rivet Date: Thu, 22 Mar 2018 10:28:44 +0000 (+0100) Subject: bus/fslmc: fix find device start condition X-Git-Url: http://git.droids-corp.org/?a=commitdiff_plain;h=78f5a2e93d746110d1da1a81a62cf6149c52e6ef;p=dpdk.git bus/fslmc: fix find device start condition 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 Acked-by: Shreyansh Jain --- diff --git a/drivers/bus/fslmc/fslmc_bus.c b/drivers/bus/fslmc/fslmc_bus.c index 4d29b53b1d..d6806dfcdd 100644 --- a/drivers/bus/fslmc/fslmc_bus.c +++ b/drivers/bus/fslmc/fslmc_bus.c @@ -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; }