From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753719AbYJOJnk (ORCPT ); Wed, 15 Oct 2008 05:43:40 -0400 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1751467AbYJOJnb (ORCPT ); Wed, 15 Oct 2008 05:43:31 -0400 Received: from ns2.suse.de ([195.135.220.15]:45183 "EHLO mx2.suse.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751109AbYJOJna (ORCPT ); Wed, 15 Oct 2008 05:43:30 -0400 Date: Wed, 15 Oct 2008 11:42:58 +0200 Message-ID: From: Takashi Iwai To: Li Zefan Cc: perex@perex.cz, LKML , fzu@wemgehoertderstaat.de Subject: Re: [PATCH] ALSA: us122l: fix missing unlock in usb_stream_hwdep_vm_fault() In-Reply-To: <48F5505B.7030408@cn.fujitsu.com> References: <48F5505B.7030408@cn.fujitsu.com> User-Agent: Wanderlust/2.12.0 (Your Wildest Dreams) SEMI/1.14.6 (Maruoka) FLIM/1.14.7 (=?ISO-8859-4?Q?Sanj=F2?=) APEL/10.6 Emacs/22.3 (x86_64-suse-linux-gnu) MULE/5.0 (SAKAKI) MIME-Version: 1.0 (generated by SEMI 1.14.6 - "Maruoka") Content-Type: text/plain; charset=US-ASCII Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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 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/ >