aboutsummaryrefslogtreecommitdiff
path: root/arch/s390/include
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/include
parentf0bacb7fc4f7defb15a6575d92f8ea4342f8f09e (diff)
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/include')
-rw-r--r--arch/s390/include/asm/pci_io.h4
1 files changed, 4 insertions, 0 deletions
diff --git a/arch/s390/include/asm/pci_io.h b/arch/s390/include/asm/pci_io.h
index 0e0bec9a3fb..83a9caa6ae5 100644
--- a/arch/s390/include/asm/pci_io.h
+++ b/arch/s390/include/asm/pci_io.h
@@ -92,6 +92,9 @@ static inline int zpci_read_single(u64 req, u64 *dst, u64 offset, u8 len)
int cc;
cc = s390pci_load(&data, req, offset);
+ if (cc)
+ goto out;
+
switch (len) {
case 1:
*((u8 *) dst) = (u8) data;
@@ -106,6 +109,7 @@ static inline int zpci_read_single(u64 req, u64 *dst, u64 offset, u8 len)
*((u64 *) dst) = (u64) data;
break;
}
+out:
return cc;
}