From: Takashi Iwai <tiwai@suse.de>
To: Li Zefan <lizf@cn.fujitsu.com>
Cc: perex@perex.cz, LKML <linux-kernel@vger.kernel.org>,
fzu@wemgehoertderstaat.de
Subject: Re: [PATCH] ALSA: us122l: fix missing unlock in usb_stream_hwdep_vm_fault()
Date: Wed, 15 Oct 2008 11:42:58 +0200 [thread overview]
Message-ID: <s5h63nu2nz1.wl%tiwai@suse.de> (raw)
In-Reply-To: <48F5505B.7030408@cn.fujitsu.com>
At Wed, 15 Oct 2008 10:07:23 +0800,
Li Zefan wrote:
>
> Should unlock us122l->mutex before returning VM_FAULT_SIGBUS.
>
> Signed-off-by: Li Zefan <lizf@cn.fujitsu.com>
Thanks, applied now.
Will be included in the next pull request.
Takashi
> ---
> sound/usb/usx2y/us122l.c | 13 +++++++------
> 1 files changed, 7 insertions(+), 6 deletions(-)
>
> diff --git a/sound/usb/usx2y/us122l.c b/sound/usb/usx2y/us122l.c
> index b441fe2..c2515b6 100644
> --- a/sound/usb/usx2y/us122l.c
> +++ b/sound/usb/usx2y/us122l.c
> @@ -118,12 +118,11 @@ static int usb_stream_hwdep_vm_fault(struct vm_area_struct *area,
> void *vaddr;
> struct us122l *us122l = area->vm_private_data;
> struct usb_stream *s;
> - int vm_f = VM_FAULT_SIGBUS;
>
> mutex_lock(&us122l->mutex);
> s = us122l->sk.s;
> if (!s)
> - goto out;
> + goto unlock;
>
> offset = vmf->pgoff << PAGE_SHIFT;
> if (offset < PAGE_ALIGN(s->read_size))
> @@ -131,7 +130,7 @@ static int usb_stream_hwdep_vm_fault(struct vm_area_struct *area,
> else {
> offset -= PAGE_ALIGN(s->read_size);
> if (offset >= PAGE_ALIGN(s->write_size))
> - goto out;
> + goto unlock;
>
> vaddr = us122l->sk.write_page + offset;
> }
> @@ -141,9 +140,11 @@ static int usb_stream_hwdep_vm_fault(struct vm_area_struct *area,
> mutex_unlock(&us122l->mutex);
>
> vmf->page = page;
> - vm_f = 0;
> -out:
> - return vm_f;
> +
> + return 0;
> +unlock:
> + mutex_unlock(&us122l->mutex);
> + return VM_FAULT_SIGBUS;
> }
>
> static void usb_stream_hwdep_vm_close(struct vm_area_struct *area)
> --
> 1.5.4.rc3
>
> --
> To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at http://vger.kernel.org/majordomo-info.html
> Please read the FAQ at http://www.tux.org/lkml/
>
prev parent reply other threads:[~2008-10-15 9:43 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-10-15 2:07 [PATCH] ALSA: us122l: fix missing unlock in usb_stream_hwdep_vm_fault() Li Zefan
2008-10-15 9:42 ` Takashi Iwai [this message]
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=s5h63nu2nz1.wl%tiwai@suse.de \
--to=tiwai@suse.de \
--cc=fzu@wemgehoertderstaat.de \
--cc=linux-kernel@vger.kernel.org \
--cc=lizf@cn.fujitsu.com \
--cc=perex@perex.cz \
/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