efi_loader: pkcs7_parse_message() returns error pointer
authorPatrick Wildt <patrick@blueri.se>
Thu, 7 May 2020 00:17:14 +0000 (02:17 +0200)
committerHeinrich Schuchardt <xypron.glpk@gmx.de>
Thu, 7 May 2020 16:23:17 +0000 (18:23 +0200)
commit6f146155f879ff42d465f0cca8ec2a7f8cb0961e
tree5d85feacbdbb146ba4d34c4d330b6dbe4401d2cc
parent9ad15227bb92acc2bf73c60da1bcf2ae3774246d
efi_loader: pkcs7_parse_message() returns error pointer

Since pkcs7_parse_message() returns an error pointer, we must not
check for NULL.  We have to explicitly set msg to NULL in the error
case, otherwise the call to pkcs7_free_message() on the goto err
path will assume it's a valid object.

Signed-off-by: Patrick Wildt <patrick@blueri.se>
Add missing include linux/err.h
Reviewed-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
lib/efi_loader/efi_image_loader.c