limine: Ensure framebuffer pointer of terminal is always valid
diff --git a/common/protos/limine.c b/common/protos/limine.c
index e0c51a43..2e28519c 100644
--- a/common/protos/limine.c
+++ b/common/protos/limine.c
@@ -547,6 +547,13 @@ skip_fb_init:;
(uint64_t)fb.framebuffer_pitch * fb.framebuffer_height,
MEMMAP_FRAMEBUFFER, false, false, false, true);
+ // For now we only support 1 framebuffer
+ struct limine_framebuffer *fbp = ext_mem_alloc(sizeof(struct limine_framebuffer));
+
+ if (term_fb_ptr != NULL) {
+ *term_fb_ptr = reported_addr(fbp);
+ }
+
struct limine_framebuffer_request *framebuffer_request = get_request(LIMINE_FRAMEBUFFER_REQUEST);
if (framebuffer_request == NULL) {
break; // next feature
@@ -555,13 +562,6 @@ skip_fb_init:;
struct limine_framebuffer_response *framebuffer_response =
ext_mem_alloc(sizeof(struct limine_framebuffer_response));
- // For now we only support 1 framebuffer
- struct limine_framebuffer *fbp = ext_mem_alloc(sizeof(struct limine_framebuffer));
-
- if (term_fb_ptr != NULL) {
- *term_fb_ptr = reported_addr(fbp);
- }
-
struct edid_info_struct *edid_info = get_edid_info();
if (edid_info != NULL) {
fbp->edid_size = sizeof(struct edid_info_struct);
