|
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [Xen-devel] [PATCH 1/2] efi/boot: fix set_color function
- 0 is a possible and allowed value for a color mask accroding to
UEFI Spec 2.6 (11.9) especially for reserved mask
- add missing pointer dereference
Without these changes non-TrueColor modes won't work which will cause
GOP init to fail - observed while trying to boot EFI Xen with Cirrus VGA.
Signed-off-by: Igor Druzhinin <igor.druzhinin@xxxxxxxxxx>
---
xen/common/efi/boot.c | 8 ++++++--
1 file changed, 6 insertions(+), 2 deletions(-)
diff --git a/xen/common/efi/boot.c b/xen/common/efi/boot.c
index 9a89414..933db88 100644
--- a/xen/common/efi/boot.c
+++ b/xen/common/efi/boot.c
@@ -1113,10 +1113,14 @@ static int __init __maybe_unused set_color(u32 mask,
int bpp, u8 *pos, u8 *sz)
if ( bpp < 0 )
return bpp;
if ( !mask )
- return -EINVAL;
+ {
+ *pos = 0;
+ *sz = 0;
+ return bpp;
+ }
for ( *pos = 0; !(mask & 1); ++*pos )
mask >>= 1;
- for ( *sz = 0; mask & 1; ++sz)
+ for ( *sz = 0; mask & 1; ++*sz)
mask >>= 1;
if ( mask )
return -EINVAL;
--
2.7.4
_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxxxxxxxxx
https://lists.xenproject.org/mailman/listinfo/xen-devel
|
![]() |
Lists.xenproject.org is hosted with RackSpace, monitoring our |