From: "Bruno Prémont" <bonbons@linux-vserver.org>
To: linux-fbdev@vger.kernel.org
Subject: fbcon: fbcon_fb_unbind() mixing up vc/fb indexes?
Date: Mon, 27 Sep 2010 20:23:51 +0000 [thread overview]
Message-ID: <20100927222351.1e15e2fd@neptune.home> (raw)
Hi James,
What's your opinion regarding the code I marked in below quoted
fbcon.c snipplet?
This looks wrong, setting 'new_idx' to 'i', I would rather see it set to
con2fb_map[i] instead as it's used as index into registered_fb[] by
set_con2fb_map(), 'i' itself being used as vc index!
Bruno
drivers/video/console/fbcon.c:
2991 static int fbcon_fb_unbind(int idx)
2992 {
2993 int i, new_idx = -1, ret = 0;
2994
2995 if (!fbcon_has_console_bind)
2996 return 0;
2997
2998 for (i = first_fb_vc; i <= last_fb_vc; i++) {
2999 if (con2fb_map[i] != idx &&
3000 con2fb_map[i] != -1) {
3001 new_idx = i;
^^^^^^^^^^^
3002 break;
3003 }
3004 }
3005
3006 if (new_idx != -1) {
3007 for (i = first_fb_vc; i <= last_fb_vc; i++) {
3008 if (con2fb_map[i] = idx)
3009 set_con2fb_map(i, new_idx, 0);
^^^^^^^
3010 }
3011 } else
3012 ret = fbcon_unbind();
3013
3014 return ret;
3015 }
next reply other threads:[~2010-09-27 20:23 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-09-27 20:23 Bruno Prémont [this message]
-- strict thread matches above, loose matches on Subject: below --
2010-11-01 16:54 fbcon: fbcon_fb_unbind() mixing up vc/fb indexes? James Simmons
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=20100927222351.1e15e2fd@neptune.home \
--to=bonbons@linux-vserver.org \
--cc=linux-fbdev@vger.kernel.org \
/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;
as well as URLs for NNTP newsgroup(s).