mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [2.6.35 patch] add missing unlock_kernel calls...
@ 2010-08-08 14:30 Daniel J Blueman
  2010-08-08 14:58 ` Arnd Bergmann
  0 siblings, 1 reply; 3+ messages in thread
From: Daniel J Blueman @ 2010-08-08 14:30 UTC (permalink / raw)
  To: Roger Lucas; +Cc: Linux Kernel

Hi Roger,

Here is a fix for 2.6.36-rc1:

Ensure the BKL is dropped along all paths.

Signed-off-by: Daniel J Blueman <daniel.blueman@gmail.com>

diff --git a/drivers/hid/usbhid/hiddev.c b/drivers/hid/usbhid/hiddev.c
index c24d2fa..53263e7 100644
--- a/drivers/hid/usbhid/hiddev.c
+++ b/drivers/hid/usbhid/hiddev.c
@@ -271,16 +271,18 @@ static int hiddev_open(struct inode *inode,
struct file *file)
 	lock_kernel();
 	i = iminor(inode) - HIDDEV_MINOR_BASE;

-	if (i >= HIDDEV_MINORS || i < 0 || !hiddev_table[i])
+	if (i >= HIDDEV_MINORS || i < 0 || !hiddev_table[i]) {
+		unlock_kernel();
 		return -ENODEV;
+	}

-	if (!(list = kzalloc(sizeof(struct hiddev_list), GFP_KERNEL)))
+	if (!(list = kzalloc(sizeof(struct hiddev_list), GFP_KERNEL))) {
+		unlock_kernel();
 		return -ENOMEM;
-	mutex_init(&list->thread_lock);
+	}

+	mutex_init(&list->thread_lock);
 	list->hiddev = hiddev_table[i];
-
-
 	file->private_data = list;

 	/*
-- 
Daniel J Blueman

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

end of thread, other threads:[~2010-08-08 15:01 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2010-08-08 14:30 [2.6.35 patch] add missing unlock_kernel calls Daniel J Blueman
2010-08-08 14:58 ` Arnd Bergmann
2010-08-08 15:01   ` Daniel J Blueman

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®