aboutsummaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorHeinrich Schuchardt <xypron.glpk@gmx.de>2017-10-08 06:57:25 +0200
committerAlexander Graf <agraf@suse.de>2017-10-09 07:00:37 +0200
commit7f8ec5b63e5a8774bfcadafbc0d9583686b00455 (patch)
tree7e2f713e3ef24dbae4cbcbf605492e40740a1a7b /lib
parentc155dfeb1e17181998e66830b677baa8983daf6b (diff)
downloadu-boot-7f8ec5b63e5a8774bfcadafbc0d9583686b00455.zip
u-boot-7f8ec5b63e5a8774bfcadafbc0d9583686b00455.tar.gz
u-boot-7f8ec5b63e5a8774bfcadafbc0d9583686b00455.tar.bz2
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>
Diffstat (limited to 'lib')
-rw-r--r--lib/efi_selftest/efi_selftest_tpl.c3
1 files changed, 2 insertions, 1 deletions
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;
}
/*