]> www.infradead.org Git - users/jedix/linux-maple.git/commit
PCI: Fix unaligned accesses in VC code
authorDavid Miller <davem@davemloft.net>
Sun, 19 Jun 2016 06:52:25 +0000 (23:52 -0700)
committerShannon Nelson <shannon.nelson@oracle.com>
Wed, 31 May 2017 23:43:46 +0000 (16:43 -0700)
commitef8b31f0ad328c483493bc96e7a8d3b70d9ed140
tree05e7ef9095759db82b8294aa8f679544c23db45a
parent1869fb7fb7aa6b497b985e60b1cc31d6f50ea8c1
PCI: Fix unaligned accesses in VC code

The save/restore buffers for VC state is first composed of a 2-byte control
register, then a bunch of 4-byte words.

This causes unaligned accesses which trap on platform such as sparc.

This is easy to fix by simply moving the buffer pointer forward by 4 bytes
instead of 2 after dealing with the control register.  The length
adjustment needs to be changed likewise as well.

Orabug: 25806778
Cherry-picked from b77b3610 PCI: Fix unaligned accesses in VC code

Fixes: 5f8fc43217a0 ("PCI: Include pci/pcie/Kconfig directly from pci/Kconfig")
Reported-by: Meelis Roos <mroos@linux.ee>
Reported-by: Anatoly Pugachev <matorola@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Bjorn Helgaas <bhelgaas@google.com>
CC: stable@vger.kernel.org # v4.6+
Signed-off-by: Shannon Nelson <shannon.nelson@oracle.com>
Signed-off-by: Allen Pais <allen.pais@oracle.com>
drivers/pci/vc.c