summaryrefslogtreecommitdiffstats
path: root/arch/x86/boot/video-vesa.c
diff options
context:
space:
mode:
authorH. Peter Anvin <hpa@zytor.com>2007-10-25 16:09:38 -0700
committerH. Peter Anvin <hpa@zytor.com>2007-10-25 20:20:06 -0700
commite6e1ace9904b72478f0c5a5aa7bd174cb6f62561 (patch)
tree8858fe4c1d37e4e9278020bf8fba369dfdddd2a7 /arch/x86/boot/video-vesa.c
parent6b6815c6d5d1dc209701d1661a7a0e09a295db2f (diff)
downloadop-kernel-dev-e6e1ace9904b72478f0c5a5aa7bd174cb6f62561.zip
op-kernel-dev-e6e1ace9904b72478f0c5a5aa7bd174cb6f62561.tar.gz
x86 setup: sizeof() is unsigned, unbreak comparisons
We use signed values for limit checking since the values can go negative under certain circumstances. However, sizeof() is unsigned and forces the comparison to be unsigned, so move the comparison into the heap_free() macros so we can ensure it is a signed comparison. Signed-off-by: H. Peter Anvin <hpa@zytor.com>
Diffstat (limited to 'arch/x86/boot/video-vesa.c')
-rw-r--r--arch/x86/boot/video-vesa.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/arch/x86/boot/video-vesa.c b/arch/x86/boot/video-vesa.c
index 1921907..4716b9a 100644
--- a/arch/x86/boot/video-vesa.c
+++ b/arch/x86/boot/video-vesa.c
@@ -57,7 +57,7 @@ static int vesa_probe(void)
while ((mode = rdfs16(mode_ptr)) != 0xffff) {
mode_ptr += 2;
- if (heap_free() < sizeof(struct mode_info))
+ if (!heap_free(sizeof(struct mode_info)))
break; /* Heap full, can't save mode info */
if (mode & ~0x1ff)
OpenPOWER on IntegriCloud