]> git.kernelconcepts.de Git - karo-tx-linux.git/commit
vfio/pci: Fix sizing of DPA and THP express capabilities
authorAlex Williamson <alex.williamson@redhat.com>
Fri, 30 May 2014 16:50:31 +0000 (10:50 -0600)
committerAlex Williamson <alex.williamson@redhat.com>
Fri, 30 May 2014 16:50:31 +0000 (10:50 -0600)
commitafa63252b2ab85614929405971105c3b20d675ba
treeaa4d1a7b38948d364be6e76e5834224e70e4e9a2
parentc7208164e66f63e3ec1759b98087849286410741
vfio/pci: Fix sizing of DPA and THP express capabilities

When sizing the TPH capability we store the register containing the
table size into the 'dword' variable, but then use the uninitialized
'byte' variable to analyze the size.  The table size is also actually
reported as an N-1 value, so correct sizing to account for this.

The round_up() for both TPH and DPA is unnecessary, remove it.

Detected by Coverity: CID 714665 & 715156

Signed-off-by: Alex Williamson <alex.williamson@redhat.com>
drivers/vfio/pci/vfio_pci_config.c