]> git.ipfire.org Git - thirdparty/kernel/stable.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)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 27 Jul 2016 15:42:20 +0000 (08:42 -0700)
commit5109ee4274474fe3212d50d8083697e281ba7940
treefb5f05b68586be2e161e1c6da8d62397573f8f7a
parent0e3e49c34861ce25d8cb95b0fef1be249dfe2434
PCI: Fix unaligned accesses in VC code

commit ef0dab4aae14e25efddf1577736f8450132800c5 upstream.

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.

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>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/pci/vc.c