From: Arnd Bergmann <arnd@arndb.de>
To: Daniel J Blueman <daniel.blueman@gmail.com>
Cc: Roger Lucas <vt8231@hiddenengine.co.uk>,
Linux Kernel <linux-kernel@vger.kernel.org>
Subject: Re: [2.6.35 patch] add missing unlock_kernel calls...
Date: Sun, 8 Aug 2010 16:58:19 +0200 [thread overview]
Message-ID: <201008081658.19790.arnd@arndb.de> (raw)
In-Reply-To: <AANLkTi=G9+wqWhJmX7QarQXeSw-8qASXMrz6mKvbBNw2@mail.gmail.com>
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
next prev parent reply other threads:[~2010-08-08 14:58 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-08-08 14:30 [2.6.35 patch] add missing unlock_kernel calls Daniel J Blueman
2010-08-08 14:58 ` Arnd Bergmann [this message]
2010-08-08 15:01 ` Daniel J Blueman
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=201008081658.19790.arnd@arndb.de \
--to=arnd@arndb.de \
--cc=daniel.blueman@gmail.com \
--cc=linux-kernel@vger.kernel.org \
--cc=vt8231@hiddenengine.co.uk \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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.