From: Heinrich Schuchardt Date: Sun, 8 Oct 2017 04:57:25 +0000 (+0200) Subject: efi_selftest: avoid dereferencing NULL in tpl test X-Git-Tag: v2017.11-rc2~55^2~10 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=7f8ec5b63e5a8774bfcadafbc0d9583686b00455;p=platform%2Fkernel%2Fu-boot.git efi_selftest: avoid dereferencing NULL in tpl test The task priority levels test uses two events one passes the notification counter as context. The other passes NULL. Both use the same notification function. So we need to check for NULL here. Signed-off-by: Heinrich Schuchardt Reviewed-by: Simon Glass Signed-off-by: Alexander Graf --- diff --git a/lib/efi_selftest/efi_selftest_tpl.c b/lib/efi_selftest/efi_selftest_tpl.c index 0b78ee7..b8c0e70 100644 --- a/lib/efi_selftest/efi_selftest_tpl.c +++ b/lib/efi_selftest/efi_selftest_tpl.c @@ -26,7 +26,8 @@ static void EFIAPI notify(struct efi_event *event, void *context) { unsigned int *count = context; - ++*count; + if (count) + ++*count; } /*