aboutsummaryrefslogtreecommitdiff
path: root/hdata
diff options
context:
space:
mode:
authorAnanth N Mavinakayanahalli <ananth@in.ibm.com>2015-06-18 13:42:54 +0530
committerStewart Smith <stewart@linux.vnet.ibm.com>2015-06-19 07:37:36 +1000
commitf2f04830b08a3be7d7fb4af1e412e69d3caa5377 (patch)
treecf94fea7992931b83178abc6b08d16bad50fb53c /hdata
parentff33d18c92b794a3343cbed2b3f79f0f31c87760 (diff)
downloadskiboot-f2f04830b08a3be7d7fb4af1e412e69d3caa5377.zip
skiboot-f2f04830b08a3be7d7fb4af1e412e69d3caa5377.tar.gz
skiboot-f2f04830b08a3be7d7fb4af1e412e69d3caa5377.tar.bz2
Fix NULL pointer dereference
Fix NULL pointer dereference in paca.c Signed-off-by: Ananth N Mavinakayanahalli <ananth@in.ibm.com> V2: Use CHECK_SPPTR instead of NULL Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
Diffstat (limited to 'hdata')
-rw-r--r--hdata/paca.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/hdata/paca.c b/hdata/paca.c
index d4360e7..b0e6426 100644
--- a/hdata/paca.c
+++ b/hdata/paca.c
@@ -158,6 +158,9 @@ static void add_icps(void)
const struct sppaca_cpu_id *id;
id = HDIF_get_idata(paca, SPPACA_IDATA_CPU_ID, &size);
+ if (!CHECK_SPPTR(id))
+ continue;
+
if (pir != be32_to_cpu(id->pir))
continue;
ibase = cleanup_addr(be64_to_cpu(id->ibase));
@@ -268,6 +271,9 @@ static bool __paca_parse(void)
__be32 *new_prop;
id = HDIF_get_idata(paca, 2, &size);
+ if (!CHECK_SPPTR(id))
+ continue;
+
ve_flags = be32_to_cpu(id->verify_exists_flags);
state = (ve_flags & CPU_ID_VERIFY_MASK) >> CPU_ID_VERIFY_SHIFT;
switch (state) {