[08/12] hdata/paca: Fix possible dereference of NULL (CID 141080)

Submitted by Cyril Bur on Aug. 3, 2017, 6:45 a.m.

Details

Message ID 20170803064551.3439-8-cyril.bur@au1.ibm.com
State Accepted
Headers show

Commit Message

Cyril Bur Aug. 3, 2017, 6:45 a.m.
Fixes: CID 141080
Signed-off-by: Cyril Bur <cyril.bur@au1.ibm.com>
---
 hdata/paca.c | 3 +++
 1 file changed, 3 insertions(+)

Comments

Vasant Hegde Aug. 7, 2017, 5:08 a.m.
On 08/03/2017 12:15 PM, Cyril Bur wrote:
> Fixes: CID 141080
> Signed-off-by: Cyril Bur <cyril.bur@au1.ibm.com>

Looks good.


Reviewed-by: Vasant Hegde <hegdevasant@linux.vnet.ibm.com>

-Vasant

Patch hide | download patch | download mbox

diff --git a/hdata/paca.c b/hdata/paca.c
index eaad0d4d..3d13a5f2 100644
--- a/hdata/paca.c
+++ b/hdata/paca.c
@@ -153,6 +153,9 @@  static void add_xics_icps(void)
 			continue;
 
 		intsrv = dt_find_property(cpu, "ibm,ppc-interrupt-server#s");
+		if (!intsrv)
+			continue;
+
 		pir = dt_prop_get_u32(cpu, "ibm,pir");
 
 		/* Get ibase address */