boot/efi: fix NULL dereference
authorZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>
Mon, 27 Nov 2017 12:22:56 +0000 (12:22 +0000)
committerZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>
Tue, 28 Nov 2017 08:25:38 +0000 (09:25 +0100)
commitbceda88b5234a6d2ce53073918bc5ee4ac7a869f
tree4ac631812519c2c6b858f007313667542979a6ee
parentbdd73ac5c221d393cb9c560c5b212fffeda4f296
boot/efi: fix NULL dereference

The comment above makes the intent of the code pretty clear:
"use security2_protocol == NULL as indicator".
So revert the condition in the check and fix the logic in the comment while
at it.

The question is how this could have ever worked: if BS->LocateProtocol
(which is supposedly optional) ever failed, we'd crash here. Strange.

Found by coverity.
src/boot/efi/shim.c