LKML Archive on lore.kernel.org
help / color / mirror / Atom feed
* [PATCH] [drivers/video/fb] Eliminate recursive mutex in compat fb ioctl path
@ 2008-11-03  7:06 Keith Packard
  2008-11-03 10:12 ` Geert Uytterhoeven
  0 siblings, 1 reply; 2+ messages in thread
From: Keith Packard @ 2008-11-03  7:06 UTC (permalink / raw)
  To: linux-kernel; +Cc: Keith Packard

fb_compat_ioctl grabbed the fb mutex and then called fb_ioctl, which also
grabs the same mutex. I traced through all existing fb_compat_ioctl
functions in the various fb drivers and found that they also transform their
arguments and call the native fb_ioctl function. So, it is correct to just
remove the mutex_lock/mutex_unlock pair in the top-level compat path.

Signed-off-by: Keith Packard <keithp@keithp.com>
---
 drivers/video/fbmem.c |    2 --
 1 files changed, 0 insertions(+), 2 deletions(-)

diff --git a/drivers/video/fbmem.c b/drivers/video/fbmem.c
index cd5f20d..548cf26 100644
--- a/drivers/video/fbmem.c
+++ b/drivers/video/fbmem.c
@@ -1253,7 +1253,6 @@ fb_compat_ioctl(struct file *file, unsigned int cmd, unsigned long arg)
 	struct fb_ops *fb = info->fbops;
 	long ret = -ENOIOCTLCMD;
 
-	mutex_lock(&info->lock);
 	switch(cmd) {
 	case FBIOGET_VSCREENINFO:
 	case FBIOPUT_VSCREENINFO:
@@ -1279,7 +1278,6 @@ fb_compat_ioctl(struct file *file, unsigned int cmd, unsigned long arg)
 			ret = fb->fb_compat_ioctl(info, cmd, arg);
 		break;
 	}
-	mutex_unlock(&info->lock);
 	return ret;
 }
 #endif
-- 
1.5.6.5


^ permalink raw reply related	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2008-11-03 10:12 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2008-11-03  7:06 [PATCH] [drivers/video/fb] Eliminate recursive mutex in compat fb ioctl path Keith Packard
2008-11-03 10:12 ` Geert Uytterhoeven

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).