diff options
author | Subrata Banik <subratabanik@google.com> | 2022-12-25 16:54:30 +0530 |
---|---|---|
committer | Subrata Banik <subratabanik@google.com> | 2022-12-26 15:55:28 +0000 |
commit | 25b717ad841502cf1393ae52ea4efbf2d23683fb (patch) | |
tree | 4bb5609abf5b289daa16a925db2e592a1d3061cc | |
parent | cfdd4884409bdf6eae8b12d98810df88873ae754 (diff) |
drivers/pc80/vga: Add NULL check for `vga_line_write()`
This patch ensures vga_line_write() returns if the argument 1
(aka output string) is NULL.
TEST=Able to build and boot Google/Taeko.
Signed-off-by: Subrata Banik <subratabanik@google.com>
Change-Id: I716ce82c0afe21f7fe2f6d7bdc5229f8087242fa
Reviewed-on: https://review.coreboot.org/c/coreboot/+/71264
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Tarun Tuli <taruntuli@google.com>
-rw-r--r-- | src/drivers/pc80/vga/vga.c | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/src/drivers/pc80/vga/vga.c b/src/drivers/pc80/vga/vga.c index 9961e3f59d..3471c944a1 100644 --- a/src/drivers/pc80/vga/vga.c +++ b/src/drivers/pc80/vga/vga.c @@ -262,6 +262,9 @@ vga_frame_set(unsigned int line, unsigned int character) void vga_line_write(unsigned int line, const char *string) { + if (!string) + return; + unsigned short *p = (unsigned short *)VGA_FB + (VGA_COLUMNS * line); size_t i, len = strlen(string); |