From: Jonathan Corbet Date: Thu, 15 May 2008 17:07:52 +0000 (-0600) Subject: misc: cdev lock_kernel() pushdown X-Git-Tag: v2.6.27-rc1~1103^2~127 X-Git-Url: https://err.no/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=309c4551c0fa0897d5343c36cbfbfa39f1f41b88;p=linux-2.6 misc: cdev lock_kernel() pushdown misc_open() looks fine, but who knows what all of the misc drivers are doing in their open() functions? Signed-off-by: Jonathan Corbet --- diff --git a/drivers/char/misc.c b/drivers/char/misc.c index eaace0db0f..6e1563c3d3 100644 --- a/drivers/char/misc.c +++ b/drivers/char/misc.c @@ -49,6 +49,7 @@ #include #include #include +#include /* * Head entry for the doubly linked miscdevice list @@ -118,6 +119,7 @@ static int misc_open(struct inode * inode, struct file * file) int err = -ENODEV; const struct file_operations *old_fops, *new_fops = NULL; + lock_kernel(); mutex_lock(&misc_mtx); list_for_each_entry(c, &misc_list, list) { @@ -155,6 +157,7 @@ static int misc_open(struct inode * inode, struct file * file) fops_put(old_fops); fail: mutex_unlock(&misc_mtx); + unlock_kernel(); return err; }