fb_set_suspend() must be called with the console semaphore held, which
commit5510634f799436618ae1834c8c6011e713165146
authorAndrea Righi <arighi@develer.com>
Wed, 24 Aug 2011 23:46:21 +0000 (25 09:46 +1000)
committerStephen Rothwell <sfr@canb.auug.org.au>
Wed, 31 Aug 2011 04:27:20 +0000 (31 14:27 +1000)
tree82b10ce034e1d0746f8648cdbf3590e550271495
parentbb7f1af4505e1faa0763a4a00744bbd03e5bc0d8
fb_set_suspend() must be called with the console semaphore held, which
means the code path coming in here will first take the console_lock() and
then call lock_fb_info().

However several framebuffer ioctl commands acquire these locks in reverse
order (lock_fb_info() and then console_lock()).  This gives rise to
potential AB-BA deadlock.

Fix this by changing the order of acquisition in the ioctl commands that
make use of console_lock().

Signed-off-by: Andrea Righi <arighi@develer.com>
Reported-by: Peter Nordström (Palm GBU) <peter.nordstrom@palm.com>
Cc: Geert Uytterhoeven <geert@linux-m68k.org>
Cc: <stable@kernel.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
drivers/video/fbmem.c