summaryrefslogtreecommitdiffstats
path: root/arch/s390/pci/pci_insn.c
diff options
context:
space:
mode:
authorSebastian Ott <sebott@linux.vnet.ibm.com>2013-04-16 14:17:15 +0200
committerMartin Schwidefsky <schwidefsky@de.ibm.com>2013-04-17 14:07:38 +0200
commitb170bad40dab1a1684d629b37cb65a5281d35bd8 (patch)
tree40f24811118d28edda9a99b40599f59913f01615 /arch/s390/pci/pci_insn.c
parents390/pci: add exception table to load/store instructions (diff)
downloadlinux-b170bad40dab1a1684d629b37cb65a5281d35bd8.tar.xz
linux-b170bad40dab1a1684d629b37cb65a5281d35bd8.zip
s390/pci: do not read data after failed load
If a pci load instruction fails the content of the register where the data is stored is possibly unchanged. Fix the inline assembly wrapper __pcilg to not return stale data. Additionally fix the callers of this function who access uninitialized variables. Reviewed-by: Gerald Schaefer <gerald.schaefer@de.ibm.com> Signed-off-by: Sebastian Ott <sebott@linux.vnet.ibm.com> Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
Diffstat (limited to 'arch/s390/pci/pci_insn.c')
-rw-r--r--arch/s390/pci/pci_insn.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/arch/s390/pci/pci_insn.c b/arch/s390/pci/pci_insn.c
index 4bc32f368f7d..22eeb9d7ffeb 100644
--- a/arch/s390/pci/pci_insn.c
+++ b/arch/s390/pci/pci_insn.c
@@ -103,7 +103,9 @@ static inline int __pcilg(u64 *data, u64 req, u64 offset, u8 *status)
: "d" (__offset)
: "cc");
*status = __req >> 24 & 0xff;
- *data = __data;
+ if (!cc)
+ *data = __data;
+
return cc;
}