a buglet in fbcon_getxy

Message ID 20001028174652.A32140@gondor.apana.org.au
State New, archived
Headers show
Series
  • a buglet in fbcon_getxy
Related show

Commit Message

Herbert Xu Oct. 28, 2000, 6:46 a.m. UTC
This is probably responsible for
	http://bugs.debian.org/72378

The patch should apply cleanly for both 2.2 and 2.4 test.

Patch

Index: drivers/video/fbcon.c
===================================================================
RCS file: /home/gondor/herbert/src/CVS/debian/kernel-source/drivers/video/fbcon.c,v
retrieving revision 1.1.1.5
diff -u -r1.1.1.5 fbcon.c
--- drivers/video/fbcon.c	2000/09/04 17:39:22	1.1.1.5
+++ drivers/video/fbcon.c	2000/10/28 04:50:14
@@ -1806,12 +1806,13 @@ 
     	    y += softback_lines;
     	ret = pos + (conp->vc_cols - x) * 2;
     } else if (conp->vc_num == fg_console && softback_lines) {
-    	unsigned long offset = (pos - softback_curr) / 2;
+    	unsigned long offset = pos - softback_curr;
     	
+    	if (pos < softback_curr)
+    	    offset += softback_end - softback_buf;
+    	offset /= 2;
     	x = offset % conp->vc_cols;
     	y = offset / conp->vc_cols;
-    	if (pos < softback_curr)
-	    y += (softback_end - softback_buf) / conp->vc_size_row;
 	ret = pos + (conp->vc_cols - x) * 2;
 	if (ret == softback_end)
 	    ret = softback_buf;