public inbox for kernel-janitors@vger.kernel.org
 help / color / mirror / Atom feed
From: Dan Carpenter <dan.carpenter@oracle.com>
To: Julia Lawall <julia@diku.dk>
Cc: Jiri Kosina <jkosina@suse.cz>,
	kernel-janitors@vger.kernel.org, linux-input@vger.kernel.org,
	linux-kernel@vger.kernel.org
Subject: Re: [PATCH 3/5] drivers/hid/hid-roccat.c: eliminate a null pointer
Date: Sat, 29 Oct 2011 06:24:13 +0000	[thread overview]
Message-ID: <20111029062412.GG14881@longonot.mountain> (raw)
In-Reply-To: <1319846297-2985-3-git-send-email-julia@diku.dk>

On Sat, Oct 29, 2011 at 01:58:15AM +0200, Julia Lawall wrote:
> diff --git a/drivers/hid/hid-roccat.c b/drivers/hid/hid-roccat.c
> index 2596321..36a28b8 100644
> --- a/drivers/hid/hid-roccat.c
> +++ b/drivers/hid/hid-roccat.c
> @@ -163,14 +163,15 @@ static int roccat_open(struct inode *inode, struct file *file)
>  
>  	device = devices[minor];
>  
> -	mutex_lock(&device->readers_lock);
> -
>  	if (!device) {
>  		pr_emerg("roccat device with minor %d doesn't exist\n", minor);
> -		error = -ENODEV;
> -		goto exit_err;
> +		kfree(reader);
> +		mutex_lock(&devices_lock);

Typo.  mutex_unlock() instead of mutex_lock().

> +		return -ENODEV;
>  	}
>  
> +	mutex_lock(&device->readers_lock);
> +
>  	if (!device->open++) {
>  		/* power on device on adding first reader */
>  		error = hid_hw_power(device->hid, PM_HINT_FULLON);
> 

regards,
dan carpenter

  reply	other threads:[~2011-10-29  6:24 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-10-28 23:58 [PATCH 3/5] drivers/hid/hid-roccat.c: eliminate a null pointer dereference Julia Lawall
2011-10-29  6:24 ` Dan Carpenter [this message]
2011-10-29  9:36   ` [PATCH 3/5] drivers/hid/hid-roccat.c: eliminate a null Arend van Spriel
2011-10-29 10:53     ` [PATCH 3/5] drivers/hid/hid-roccat.c: eliminate a null pointer dereference David Herrmann
2011-10-29 12:11       ` [PATCH 3/5 v2] drivers/hid/hid-roccat.c: eliminate a null pointer Julia Lawall
2011-10-29 17:00         ` Jiri Kosina
2011-10-29 18:18           ` Julia Lawall
2011-10-29 18:45           ` [PATCH 3/5 v3] " Julia Lawall
2011-11-01 14:14             ` Jiri Kosina
2011-10-31  9:22       ` [PATCH 3/5] drivers/hid/hid-roccat.c: eliminate a null Arend van Spriel

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=20111029062412.GG14881@longonot.mountain \
    --to=dan.carpenter@oracle.com \
    --cc=jkosina@suse.cz \
    --cc=julia@diku.dk \
    --cc=kernel-janitors@vger.kernel.org \
    --cc=linux-input@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox