RAS: ras_common: Add null pointer check for error record probe function
authorSughosh Ganu <sughosh.ganu@arm.com>
Sat, 12 May 2018 05:32:31 +0000 (11:02 +0530)
committerSughosh Ganu <sughosh.ganu@arm.com>
Thu, 26 Jul 2018 16:28:45 +0000 (21:58 +0530)
Add a null pointer check for the error record probe
function -- avoids a panic in case a platform has not defined it.

Change-Id: I1139fa0df33297a12ec16615cacd07540925f991
Signed-off-by: Sughosh Ganu <sughosh.ganu@arm.com>
lib/extensions/ras/ras_common.c

index 0335a7bcb3aa00924595a84dae119ff1f0bd9c1e..5a2b43c5629a80c2452c66638e943eb925ff60d2 100644 (file)
@@ -114,9 +114,10 @@ static int ras_interrupt_handler(uint32_t intr_raw, uint32_t flags,
                panic();
        }
 
-
-       ret = selected->err_record->probe(selected->err_record, &probe_data);
-       assert(ret != 0);
+       if (selected->err_record->probe) {
+               ret = selected->err_record->probe(selected->err_record, &probe_data);
+               assert(ret != 0);
+       }
 
        /* Call error handler for the record group */
        assert(selected->err_record->handler != NULL);