diff options
author | Benjamin Herrenschmidt <benh@kernel.crashing.org> | 2018-08-21 14:27:15 +1000 |
---|---|---|
committer | Stewart Smith <stewart@linux.vnet.ibm.com> | 2018-09-13 15:19:36 +1000 |
commit | 0a087154ca4f6759ad1e25c0b3933a9e6caeb456 (patch) | |
tree | 5f9a00c9a80c3e7097c9dbfb2b022820e51a82e5 /hw | |
parent | cfecc3960c00ea9a9871c2358d8710c5d2c6539b (diff) | |
download | blackbird-skiboot-0a087154ca4f6759ad1e25c0b3933a9e6caeb456.tar.gz blackbird-skiboot-0a087154ca4f6759ad1e25c0b3933a9e6caeb456.zip |
phb4: Handle allocation errors in phb4_eeh_dump_regs()
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>
Diffstat (limited to 'hw')
-rw-r--r-- | hw/phb4.c | 4 |
1 files changed, 4 insertions, 0 deletions
@@ -2072,6 +2072,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); |