Explorar o código

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 <xypron.glpk@gmx.de>
Reviewed-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Alexander Graf <agraf@suse.de>
Heinrich Schuchardt %!s(int64=7) %!d(string=hai) anos
pai
achega
7f8ec5b63e
Modificáronse 1 ficheiros con 2 adicións e 1 borrados
  1. 2 1
      lib/efi_selftest/efi_selftest_tpl.c

+ 2 - 1
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;
 }
 
 /*