diff options
author | Kamalesh Babulal <kamalesh@linux.vnet.ibm.com> | 2015-07-10 20:55:47 +0530 |
---|---|---|
committer | Stewart Smith <stewart@linux.vnet.ibm.com> | 2015-07-17 12:25:07 +1000 |
commit | a9ea306bef9e08430cae1218cec7b4aad66d595f (patch) | |
tree | 48208851deee1180688a36c610f8beaeab428a14 /hdata/paca.c | |
parent | 3aca615306e00a2abef7bd45dba2e7046085243a (diff) | |
download | skiboot-a9ea306bef9e08430cae1218cec7b4aad66d595f.zip skiboot-a9ea306bef9e08430cae1218cec7b4aad66d595f.tar.gz skiboot-a9ea306bef9e08430cae1218cec7b4aad66d595f.tar.bz2 |
hdata/paca: Check for dt_find_property() return value
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@linux.vnet.ibm.com>
Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
Diffstat (limited to 'hdata/paca.c')
-rw-r--r-- | hdata/paca.c | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/hdata/paca.c b/hdata/paca.c index 4f2006a..6f5a1b4 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; } |