diff --git a/drivers/tty/vt/vt.c b/drivers/tty/vt/vt.c index 01645e87b3d5..f24e627b7402 100644 --- a/drivers/tty/vt/vt.c +++ b/drivers/tty/vt/vt.c @@ -1171,8 +1171,13 @@ static inline int resize_screen(struct vc_data *vc, int width, int height, /* Resizes the resolution of the display adapater */ int err = 0; - if (vc->vc_mode != KD_GRAPHICS && vc->vc_sw->con_resize) + if (vc->vc_sw->con_resize) { + // If we have a resize function but are in KD_GRAPHICS mode, + // we can't actually do a resize and need to error out. + if (vc->vc_mode == KD_GRAPHICS) + return -EINVAL; err = vc->vc_sw->con_resize(vc, width, height, user); + } return err; }