[Skiboot] [PATCH] [paca] Fix NULL pointer dereference
Ananth N Mavinakayanahalli
ananth at in.ibm.com
Tue Jun 16 21:06:36 AEST 2015
Fix NULL pointer dereference in paca.c
Signed-off-by: Ananth N Mavinakayanahalli <ananth at in.ibm.com>
---
hdata/paca.c | 6 ++++++
1 file changed, 6 insertions(+)
diff --git a/hdata/paca.c b/hdata/paca.c
index d4360e7..d188819 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 (id == NULL)
+ 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 (id == NULL)
+ continue;
+
ve_flags = be32_to_cpu(id->verify_exists_flags);
state = (ve_flags & CPU_ID_VERIFY_MASK) >> CPU_ID_VERIFY_SHIFT;
switch (state) {
More information about the Skiboot
mailing list