bus/fslmc: fix VFIO group descriptor check
authorYunjian Wang <wangyunjian@huawei.com>
Tue, 19 May 2020 03:42:12 +0000 (11:42 +0800)
committerDavid Marchand <david.marchand@redhat.com>
Mon, 5 Oct 2020 08:08:57 +0000 (10:08 +0200)
commit4b10ae80272b1bec113fbf5848065b66f030c327
tree6548d45e6c11aa1999f9b6594f52982ef503af39
parent1f16fa99aa36e043e395184d6ad37a348eafeba7
bus/fslmc: fix VFIO group descriptor check

The issue is that a file descriptor at 0 is a valid one. Currently
the file not found, the return value will be set to 0. As a result,
it is impossible to distinguish between a correct descriptor and a
failed return value. Fix it to return -ENOENT instead of 0.

Fixes: a69f79300262 ("bus/fslmc: support multi VFIO group")
Cc: stable@dpdk.org
Signed-off-by: Yunjian Wang <wangyunjian@huawei.com>
Acked-by: Anatoly Burakov <anatoly.burakov@intel.com>
Acked-by: Hemant Agrawal <hemant.agrawal@nxp.com>
drivers/bus/fslmc/fslmc_vfio.c