* [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 related [flat|nested] 3+ messages in thread
* Re: [2.6.35 patch] add missing unlock_kernel calls...
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
0 siblings, 1 reply; 3+ messages in thread
From: Arnd Bergmann @ 2010-08-08 14:58 UTC (permalink / raw)
To: Daniel J Blueman; +Cc: Roger Lucas, Linux Kernel
On Sunday 08 August 2010, Daniel J Blueman wrote:
> 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;
>
> /*
This should no longer be needed, since the BKL is not taken
in this code any more.
Arnd
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [2.6.35 patch] add missing unlock_kernel calls...
2010-08-08 14:58 ` Arnd Bergmann
@ 2010-08-08 15:01 ` Daniel J Blueman
0 siblings, 0 replies; 3+ messages in thread
From: Daniel J Blueman @ 2010-08-08 15:01 UTC (permalink / raw)
To: Arnd Bergmann; +Cc: Roger Lucas, Linux Kernel
On 8 August 2010 15:58, Arnd Bergmann <arnd@arndb.de> wrote:
> On Sunday 08 August 2010, Daniel J Blueman wrote:
>> 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;
>>
>> /*
>
> This should no longer be needed, since the BKL is not taken
> in this code any more.
All the more better then, thanks to your BKL removal patches.
Thanks,
Daniel
--
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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.