From: Anatoly Burakov Date: Fri, 22 Dec 2017 10:30:36 +0000 (+0000) Subject: vfio: fix enabled check on error X-Git-Tag: spdx-start~716 X-Git-Url: http://git.droids-corp.org/?a=commitdiff_plain;h=7b74a6e0b638ce69b9d03367ce85258e0da19807;p=dpdk.git vfio: fix enabled check on error rte_eal_check_module() might return -1, which would have been a "not false" condition for mod_available. Fix that to only report vfio being enabled if rte_eal_check_module() returns 1. Fixes: 221f7c220d6b ("vfio: move global config out of PCI files") Cc: stable@dpdk.org Signed-off-by: Anatoly Burakov --- diff --git a/lib/librte_eal/linuxapp/eal/eal_vfio.c b/lib/librte_eal/linuxapp/eal/eal_vfio.c index 3036f6094f..681eab516d 100644 --- a/lib/librte_eal/linuxapp/eal/eal_vfio.c +++ b/lib/librte_eal/linuxapp/eal/eal_vfio.c @@ -496,7 +496,7 @@ rte_vfio_enable(const char *modname) int rte_vfio_is_enabled(const char *modname) { - const int mod_available = rte_eal_check_module(modname); + const int mod_available = rte_eal_check_module(modname) > 0; return vfio_cfg.vfio_enabled && mod_available; }