[Skiboot] [PATCH 2/3] hdata/paca: Check for dt_find_property() return value

Kamalesh Babulal kamalesh at linux.vnet.ibm.com
Sat Jul 11 01:25:47 AEST 2015


dt_find_property() might return NULL. In handle_capp_recoverable,
check for return value, before dereferencing it.

Fixes Coverity defect#97844.

Signed-off-by: Kamalesh Babulal <kamalesh at linux.vnet.ibm.com>
---
 hdata/paca.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/hdata/paca.c b/hdata/paca.c
index b0e6426..eae3a82 100644
--- a/hdata/paca.c
+++ b/hdata/paca.c
@@ -109,6 +109,9 @@ static struct dt_node *find_cpu_by_hardware_proc_id(struct dt_node *root,
 			continue;
 
 		prop = dt_find_property(i, DT_PRIVATE "hw_proc_id");
+		if (!prop)
+			return NULL;
+
 		if (be32_to_cpu(*(u32 *)prop->prop) == hw_proc_id)
 			return i;
 	}
-- 
2.1.2



More information about the Skiboot mailing list