Skip to contentSkip to conversation

fbcon: rotate upside down crash

PATCH In review Stefani Seibold 2 participants 2 messages Jul 24, 2009 – Jul 27, 2009 Framebuffer layer

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 fbcon: rotate upside down crash

Attached is a bug fix for the frame console.

The current frame buffer console upside down functionality will crash using a font which has not a width of multiple by 8.

The following 1 liner will fix the rotate_ud() function,

 fbcon_rotate.h |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

--- linux-2.6.31-rc4/drivers/video/console/fbcon_rotate.h 2009-07-24
20:37:31.000000000 +0200
+++ linux-2.6.31-rc4.orig/drivers/video/console/fbcon_rotate.h

2009-06-10 05:05:27.000000000 +0200

@@ -45,7 +45,7 @@
width = (width + 7) & ~7;

for (i = 0; i < height; i++) {
- for (j = 0; j < width - shift; j++) {
+ for (j = 0; j < width; j++) {
if (pattern_test_bit(j, i, width, in))
pattern_set_bit(width - (1 + j + shift),
height - (1 + i),

#1 lore raw

(cc linux-fbdev-devel)
(un-cc adaplas - he hasn't been heard from for over a year)

Quoted 16 lines · On Fri, 24 Jul 2009 21:23:46 +0200 Stefani Seibold <[email protected]> wrote:

Attached is a bug fix for the frame console.

The current frame buffer console upside down functionality will crash using a font which has not a width of multiple by 8.

The following 1 liner will fix the rotate_ud() function,

 fbcon_rotate.h |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

--- linux-2.6.31-rc4/drivers/video/console/fbcon_rotate.h 2009-07-24
20:37:31.000000000 +0200
+++ linux-2.6.31-rc4.orig/drivers/video/console/fbcon_rotate.h

2009-06-10 05:05:27.000000000 +0200

Review line 51

Quoted 8 lines
(quoted diff) +1 -1
@@ -45,7 +45,7 @@
 	width = (width + 7) & ~7;
 
 	for (i = 0; i < height; i++) {
-		for (j = 0; j < width - shift; j++) {
+		for (j = 0; j < width; j++) {
 			if (pattern_test_bit(j, i, width, in))
 				pattern_set_bit(width - (1 + j + shift),
 						height - (1 + i),

I suspect that the patch was reversed, and that you intended this:

- for (j = 0; j < width; j++) {
+ for (j = 0; j < width - shift; j++) {

yes?

The patch was wordwrapped too - please fix the email client.

If/when resending, please add to the changelog a bit of an explanation about the change - what was wrong with the old code and how does the new code fix it, thanks.