diff options
author | Benjamin Herrenschmidt <benh@kernel.crashing.org> | 2018-08-21 14:27:15 +1000 |
---|---|---|
committer | Stewart Smith <stewart@linux.ibm.com> | 2018-09-13 18:32:18 +1000 |
commit | a20833de7e2fa9a044862cbdeb48a564544a84ed (patch) | |
tree | e99986169059ce521cd3e552dd4fcdf76fb1329d | |
parent | ecd2b6cd20a0fb5600fc5dfb20383d57e9c2f24e (diff) | |
download | skiboot-a20833de7e2fa9a044862cbdeb48a564544a84ed.zip skiboot-a20833de7e2fa9a044862cbdeb48a564544a84ed.tar.gz skiboot-a20833de7e2fa9a044862cbdeb48a564544a84ed.tar.bz2 |
phb4: Handle allocation errors in phb4_eeh_dump_regs()
[ Upstream commit 0a087154ca4f6759ad1e25c0b3933a9e6caeb456 ]
If the zalloc fails (and it can be a rather large allocation),
we will overwite memory at 0 instead of failing.
Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
Signed-off-by: Stewart Smith <stewart@linux.ibm.com>
-rw-r--r-- | hw/phb4.c | 4 |
1 files changed, 4 insertions, 0 deletions
@@ -1943,6 +1943,10 @@ static void phb4_eeh_dump_regs(struct phb4 *p) return; s = zalloc(sizeof(struct OpalIoPhb4ErrorData)); + if (!s) { + PHBERR(p, "Failed to allocate error info !\n"); + return; + } phb4_read_phb_status(p, s); |