Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

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 <corbet@lwn.net>

+3
+3
drivers/char/misc.c
··· 49 49 #include <linux/device.h> 50 50 #include <linux/tty.h> 51 51 #include <linux/kmod.h> 52 + #include <linux/smp_lock.h> 52 53 53 54 /* 54 55 * Head entry for the doubly linked miscdevice list ··· 119 118 int err = -ENODEV; 120 119 const struct file_operations *old_fops, *new_fops = NULL; 121 120 121 + lock_kernel(); 122 122 mutex_lock(&misc_mtx); 123 123 124 124 list_for_each_entry(c, &misc_list, list) { ··· 157 155 fops_put(old_fops); 158 156 fail: 159 157 mutex_unlock(&misc_mtx); 158 + unlock_kernel(); 160 159 return err; 161 160 } 162 161