efi: mokvar-table: fix some issues in new code
authorArd Biesheuvel <ardb@kernel.org>
Thu, 24 Sep 2020 15:58:22 +0000 (17:58 +0200)
committerArd Biesheuvel <ardb@kernel.org>
Tue, 29 Sep 2020 17:40:57 +0000 (19:40 +0200)
commitb89114cd018cffa5deb7def1844ce1891efd4f96
tree3978a612af031280c3b309cf3fe125989033f430
parent612b5d506d066cdf0a739963e7cd28642d500ec1
efi: mokvar-table: fix some issues in new code

Fix a couple of issues in the new mokvar-table handling code, as
pointed out by Arvind and Boris:
- don't bother checking the end of the physical region against the start
  address of the mokvar table,
- ensure that we enter the loop with err = -EINVAL,
- replace size_t with unsigned long to appease pedantic type equality
  checks.

Reviewed-by: Arvind Sankar <nivedita@alum.mit.edu>
Reviewed-by: Lenny Szubowicz <lszubowi@redhat.com>
Tested-by: Borislav Petkov <bp@suse.de>
Signed-off-by: Ard Biesheuvel <ardb@kernel.org>
drivers/firmware/efi/mokvar-table.c