vfio: fix PCI address comparison
authorQi Zhang <qi.z.zhang@intel.com>
Thu, 12 Jul 2018 14:01:42 +0000 (22:01 +0800)
committerThomas Monjalon <thomas@monjalon.net>
Fri, 20 Jul 2018 12:26:16 +0000 (14:26 +0200)
commit2a3de3710fbc54499867b44951b5b41cdb2aba35
treefa17c6aae6fd06921598d89bbdac2daf9dbebcc2
parent196e9a486cb1a0fd929a15244e7d9169ef5ede00
vfio: fix PCI address comparison

When use memcmp to compare two PCI address, sizeof(struct rte_pci_addr)
is 4 bytes aligned, and it is 8. While only 7 byte of struct rte_pci_addr
is valid. So compare the 8th byte will cause the unexpected result, which
happens when repeatedly attach/detach a device.

Fixes: 94c0776b1bad ("vfio: support hotplug")
Cc: stable@dpdk.org
Signed-off-by: Qi Zhang <qi.z.zhang@intel.com>
Acked-by: Gaetan Rivet <gaetan.rivet@6wind.com>
drivers/bus/pci/linux/pci_vfio.c