From 477911553e0443fcafad5bd96c97314aa2f8d9ea Mon Sep 17 00:00:00 2001 From: Alex Auvolat Date: Thu, 14 Jul 2016 10:47:53 +0200 Subject: Integration of scan-build and splint --- src/kernel/dev/vesa.c | 2 ++ 1 file changed, 2 insertions(+) (limited to 'src/kernel/dev/vesa.c') diff --git a/src/kernel/dev/vesa.c b/src/kernel/dev/vesa.c index f77b230..03418b4 100644 --- a/src/kernel/dev/vesa.c +++ b/src/kernel/dev/vesa.c @@ -281,6 +281,8 @@ void vesa_detect(fs_t *iofs) { uint16_t *last_mode = modes; while (*last_mode != 0xFFFF) last_mode++; + if (last_mode == modes) goto end_detect; + mode_data = (vesa_mode_t*)malloc((last_mode - modes) * sizeof(vesa_mode_t)); if (mode_data == 0) goto end_detect; -- cgit v1.2.3