]> git.baikalelectronics.ru Git - kernel.git/commit
fbmem: make read/write/ioctl use the frame buffer at open time
authorLinus Torvalds <torvalds@linux-foundation.org>
Wed, 11 May 2011 21:58:34 +0000 (14:58 -0700)
committerLinus Torvalds <torvalds@linux-foundation.org>
Thu, 12 May 2011 14:46:43 +0000 (07:46 -0700)
commit00b874eeb450c99dc9d0a286016e1fa69df337c0
treea98fbf2b466cabbc71a685a24496e08e074ecfb2
parente394498cca1adaccbd36e09cf07041325d2b1305
fbmem: make read/write/ioctl use the frame buffer at open time

read/write/ioctl on a fbcon file descriptor has traditionally used the
fbcon not when it was opened, but as it was at the time of the call.
That makes no sense, but the lack of sense is much more obvious now that
we properly ref-count the usage - it means that the ref-counting doesn't
actually protect operations we do on the frame buffer.

This changes it to look at the fb_info that we got at open time, but in
order to avoid using a frame buffer long after it has been unregistered,
we do verify that it is still current, and return -ENODEV if not.

Acked-by: Tim Gardner <tim.gardner@canonical.com>
Tested-by: Daniel J Blueman <daniel.blueman@gmail.com>
Tested-by: Anca Emanuel <anca.emanuel@gmail.com>
Cc: Bruno Prémont <bonbons@linux-vserver.org>
Cc: Alan Cox <alan@lxorguk.ukuu.org.uk>
Cc: Paul Mundt <lethal@linux-sh.org>
Cc: Dave Airlie <airlied@redhat.com>
Cc: Andy Whitcroft <andy.whitcroft@canonical.com>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
drivers/video/fbmem.c