From 78f5a2e93d746110d1da1a81a62cf6149c52e6ef Mon Sep 17 00:00:00 2001 From: Gaetan Rivet Date: Thu, 22 Mar 2018 11:28:44 +0100 Subject: [PATCH] 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 --- drivers/bus/fslmc/fslmc_bus.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) 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; } -- 2.20.1