diff options
author | Jan Beulich <JBeulich@suse.com> | 2016-08-15 09:05:45 -0600 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2016-09-24 10:09:36 +0200 |
commit | 57fea0768c7c7874eeaf59b1ab5011c6cb9251b2 (patch) | |
tree | d6f4680d7ff85b64d6eec87895fe516be03cfb9d /include | |
parent | a8529888a4bf3043d5a64de80148fda05c034305 (diff) | |
download | lwn-57fea0768c7c7874eeaf59b1ab5011c6cb9251b2.tar.gz lwn-57fea0768c7c7874eeaf59b1ab5011c6cb9251b2.zip |
efi: Make for_each_efi_memory_desc_in_map() cope with running on Xen
commit d4c4fed08f31f3746000c46cb1b20bed2959547a upstream.
While commit 55f1ea15216 ("efi: Fix for_each_efi_memory_desc_in_map()
for empty memmaps") made an attempt to deal with empty memory maps, it
didn't address the case where the map field never gets set, as is
apparently the case when running under Xen.
Reported-by: <lists@ssl-mail.com>
Tested-by: <lists@ssl-mail.com>
Cc: Vitaly Kuznetsov <vkuznets@redhat.com>
Cc: Jiri Slaby <jslaby@suse.cz>
Cc: Mark Rutland <mark.rutland@arm.com>
Signed-off-by: Jan Beulich <jbeulich@suse.com>
[ Guard the loop with a NULL check instead of pointer underflow ]
Signed-off-by: Matt Fleming <matt@codeblueprint.co.uk>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'include')
-rw-r--r-- | include/linux/efi.h | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/include/linux/efi.h b/include/linux/efi.h index f196dd0b0f2f..8aa8ddd679a0 100644 --- a/include/linux/efi.h +++ b/include/linux/efi.h @@ -1005,7 +1005,7 @@ extern int efi_memattr_apply_permissions(struct mm_struct *mm, /* Iterate through an efi_memory_map */ #define for_each_efi_memory_desc_in_map(m, md) \ for ((md) = (m)->map; \ - ((void *)(md) + (m)->desc_size) <= (m)->map_end; \ + (md) && ((void *)(md) + (m)->desc_size) <= (m)->map_end; \ (md) = (void *)(md) + (m)->desc_size) /** |