From: Yao Yiqi <yaoyiqi3@huawei.com>
To: <deller@gmx.de>, <tzimmermann@suse.de>, <simona@ffwll.ch>
Cc: <dri-devel@lists.freedesktop.org>, <linux-fbdev@vger.kernel.org>,
<linux-kernel@vger.kernel.org>
Subject: [PATCH 2/2] fbcon: Retry rotated font allocation after failure
Date: Wed, 14 Oct 2026 08:51:02 +0000 [thread overview]
Message-ID: <20261014085102.497789-2-yaoyiqi3@huawei.com> (raw)
In-Reply-To: <20261014085102.497789-1-yaoyiqi3@huawei.com>
fbcon_rotate_font() records the font and rotation it is about to handle in
par->rotated.fontdata and par->rotated.buf_rotate before calling
font_data_rotate(). If that allocation fails it clears par->rotated.buf,
but the cached font/rotation state already looks up to date, so the next
call takes the early-out and never retries. The rotated putcs/cursor ops
keep returning early on the NULL buffer and the console stays blank until
the font or the rotation is changed, even once memory is available again.
Also test par->rotated.buf in the early-out so a failed allocation is
retried the next time fbcon_rotate_font() runs.
Fixes: e4ef723d8975 ("fbcon: Avoid OOB font access if console rotation fails")
Cc: stable@vger.kernel.org
Signed-off-by: Yao Yiqi <yaoyiqi3@huawei.com>
---
drivers/video/fbdev/core/fbcon_rotate.c | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/drivers/video/fbdev/core/fbcon_rotate.c b/drivers/video/fbdev/core/fbcon_rotate.c
index 6cdbc96eeca6..6b148e0e81e6 100644
--- a/drivers/video/fbdev/core/fbcon_rotate.c
+++ b/drivers/video/fbdev/core/fbcon_rotate.c
@@ -21,7 +21,9 @@ int fbcon_rotate_font(struct fb_info *info, struct vc_data *vc)
unsigned char *buf;
int ret;
- if (par->p->fontdata == par->rotated.fontdata && par->rotate == par->rotated.buf_rotate)
+ if (par->p->fontdata == par->rotated.fontdata &&
+ par->rotate == par->rotated.buf_rotate &&
+ par->rotated.buf)
return 0;
par->rotated.fontdata = par->p->fontdata;
--
2.34.1
next prev parent reply other threads:[~2026-10-14 9:09 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-10-14 8:51 [PATCH 1/2] fbcon: Rebuild rotated font buffer on font change Yao Yiqi
2026-10-14 8:51 ` Yao Yiqi [this message]
2026-10-14 19:58 ` Helge Deller
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20261014085102.497789-2-yaoyiqi3@huawei.com \
--to=yaoyiqi3@huawei.com \
--cc=deller@gmx.de \
--cc=dri-devel@lists.freedesktop.org \
--cc=linux-fbdev@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=simona@ffwll.ch \
--cc=tzimmermann@suse.de \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox