diff options
author | Sebastian Ott <sebott@linux.vnet.ibm.com> | 2013-04-16 16:17:15 +0400 |
---|---|---|
committer | Martin Schwidefsky <schwidefsky@de.ibm.com> | 2013-04-17 16:07:38 +0400 |
commit | b170bad40dab1a1684d629b37cb65a5281d35bd8 (patch) | |
tree | 40f24811118d28edda9a99b40599f59913f01615 /arch/s390/include | |
parent | f0bacb7fc4f7defb15a6575d92f8ea4342f8f09e (diff) | |
download | linux-b170bad40dab1a1684d629b37cb65a5281d35bd8.tar.xz |
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.h | 4 |
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 0e0bec9a3fb7..83a9caa6ae53 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; } |