s390/pci: reshuffle struct used to write debug data
authorSebastian Ott <sebott@linux.vnet.ibm.com>
Fri, 9 Oct 2015 09:07:06 +0000 (11:07 +0200)
committerMartin Schwidefsky <schwidefsky@de.ibm.com>
Wed, 14 Oct 2015 12:32:17 +0000 (14:32 +0200)
zpci_err_insn writes stale stack content to the debugfs.

Ensure that the struct in zpci_err_insn is ordered in a way that
we don't have uninitialized holes in it. In addition to that
add the packed attribute.

Fixes: 3d8258e (s390/pci: move debug messages to debugfs)
Signed-off-by: Sebastian Ott <sebott@linux.vnet.ibm.com>
Reviewed-by: Gerald Schaefer <gerald.schaefer@de.ibm.com>
Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
arch/s390/pci/pci_insn.c

index dcc2634ccbe295d9746a06909dae99fca5c91780..10ca15dcab11f9eb93c22a615084260661fa1f2f 100644 (file)
 static inline void zpci_err_insn(u8 cc, u8 status, u64 req, u64 offset)
 {
        struct {
-               u8 cc;
-               u8 status;
                u64 req;
                u64 offset;
-       } data = {cc, status, req, offset};
+               u8 cc;
+               u8 status;
+       } __packed data = {req, offset, cc, status};
 
        zpci_err_hex(&data, sizeof(data));
 }