diff options
author | H. Peter Anvin <hpa@zytor.com> | 2007-10-25 19:09:38 -0400 |
---|---|---|
committer | H. Peter Anvin <hpa@zytor.com> | 2007-10-25 23:20:06 -0400 |
commit | e6e1ace9904b72478f0c5a5aa7bd174cb6f62561 (patch) | |
tree | 8858fe4c1d37e4e9278020bf8fba369dfdddd2a7 /arch/x86/boot/video.c | |
parent | 6b6815c6d5d1dc209701d1661a7a0e09a295db2f (diff) |
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.c')
-rw-r--r-- | arch/x86/boot/video.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/arch/x86/boot/video.c b/arch/x86/boot/video.c index e4ba897bf9a3..ad9712f01739 100644 --- a/arch/x86/boot/video.c +++ b/arch/x86/boot/video.c | |||
@@ -371,7 +371,7 @@ static void save_screen(void) | |||
371 | saved.curx = boot_params.screen_info.orig_x; | 371 | saved.curx = boot_params.screen_info.orig_x; |
372 | saved.cury = boot_params.screen_info.orig_y; | 372 | saved.cury = boot_params.screen_info.orig_y; |
373 | 373 | ||
374 | if (heap_free() < saved.x*saved.y*sizeof(u16)+512) | 374 | if (!heap_free(saved.x*saved.y*sizeof(u16)+512)) |
375 | return; /* Not enough heap to save the screen */ | 375 | return; /* Not enough heap to save the screen */ |
376 | 376 | ||
377 | saved.data = GET_HEAP(u16, saved.x*saved.y); | 377 | saved.data = GET_HEAP(u16, saved.x*saved.y); |