From: Jonathan Corbet Date: Thu, 15 May 2008 22:24:25 +0000 (-0600) Subject: usbcore: cdev lock_kernel() pushdown X-Git-Tag: v2.6.27-rc1~1103^2~114 X-Git-Url: http://pilppa.com/gitweb/?a=commitdiff_plain;h=20613f24bcd1cbfb08e64f0bb00c44481313b448;p=linux-2.6-omap-h63xx.git usbcore: cdev lock_kernel() pushdown usb_open() is protected by a down_read(&minor_rwsem), but I'm not sure I trust it to protect everything including subsidiary open() functions. Signed-off-by: Jonathan Corbet --- diff --git a/drivers/usb/core/file.c b/drivers/usb/core/file.c index 8133c99c6c5..c6a95395e52 100644 --- a/drivers/usb/core/file.c +++ b/drivers/usb/core/file.c @@ -18,6 +18,7 @@ #include #include #include +#include #include #include "usb.h" @@ -33,6 +34,7 @@ static int usb_open(struct inode * inode, struct file * file) int err = -ENODEV; const struct file_operations *old_fops, *new_fops = NULL; + lock_kernel(); down_read(&minor_rwsem); c = usb_minors[minor]; @@ -51,6 +53,7 @@ static int usb_open(struct inode * inode, struct file * file) fops_put(old_fops); done: up_read(&minor_rwsem); + unlock_kernel(); return err; }