net/virtio: fix PCI config error handling
authorBrian Russell <brussell@brocade.com>
Tue, 28 Aug 2018 10:12:40 +0000 (11:12 +0100)
committerThomas Monjalon <thomas@monjalon.net>
Sun, 28 Oct 2018 23:54:20 +0000 (00:54 +0100)
commit49bb1f7a0ab760a0f1fb39e27c90a1cb2ad42edd
treea83991a5e2dc872790b8319a0bd244b1b6fabd15
parente8d435f1f3a16b02011f604581c80d09fea3a44f
net/virtio: fix PCI config error handling

In virtio_read_caps and vtpci_msix_detect, rte_pci_read_config returns
the number of bytes read from PCI config or < 0 on error.
If less than the expected number of bytes are read then log the
failure and return rather than carrying on with garbage.

Fixes: 6ba1f63b5ab0 ("virtio: support specification 1.0")
Cc: stable@dpdk.org
Signed-off-by: Brian Russell <brussell@brocade.com>
Signed-off-by: Luca Boccassi <bluca@debian.org>
Reviewed-by: Tiwei Bie <tiwei.bie@intel.com>
drivers/net/virtio/virtio_pci.c