bus/ifpga: fix error check in unplug
authorRosen Xu <rosen.xu@intel.com>
Tue, 22 May 2018 10:26:16 +0000 (18:26 +0800)
committerThomas Monjalon <thomas@monjalon.net>
Tue, 22 May 2018 17:15:58 +0000 (19:15 +0200)
The control variable should be afu_dev not dev.

Coverity issue: 279455
Fixes: 05fa3d4a6539 ("bus/ifpga: add Intel FPGA bus library")
Cc: stable@dpdk.org
Signed-off-by: Rosen Xu <rosen.xu@intel.com>
drivers/bus/ifpga/ifpga_bus.c

index 45597a1..675b9a3 100644 (file)
@@ -367,7 +367,7 @@ ifpga_unplug(struct rte_device *dev)
                return -EINVAL;
 
        afu_dev = RTE_DEV_TO_AFU(dev);
-       if (!dev)
+       if (!afu_dev)
                return -ENOENT;
 
        devargs = dev->devargs;