Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751287AbZJKUlf (ORCPT ); Sun, 11 Oct 2009 16:41:35 -0400 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1751122AbZJKUle (ORCPT ); Sun, 11 Oct 2009 16:41:34 -0400 Received: from mail-ew0-f208.google.com ([209.85.219.208]:56517 "EHLO mail-ew0-f208.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751098AbZJKUld (ORCPT ); Sun, 11 Oct 2009 16:41:33 -0400 DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=date:from:to:cc:subject:message-id:references:mime-version :content-type:content-disposition:content-transfer-encoding :in-reply-to:user-agent; b=IFRNPnZM7cyNb9O2g3IfeNIc+P7cZTYHL8zhemc0JMEUzGRtg+GWLb3FiC6M8eocNP TnfHgKnQJRHfUC4MW9/3D2YA6zf6elxJv3vpHMMLNKUBiLix7VzK9mhS9nfKpb8s7JaL qqTa+8zDf2K1Mzn3gJhe0TW5tEXZ4CotRf19o= Date: Sun, 11 Oct 2009 22:40:54 +0200 From: Frederic Weisbecker To: Oliver Neukum Cc: John Kacur , Alan Cox , linux-kernel@vger.kernel.org, Thomas Gleixner , Jonathan Corbet , Peter Zijlstra , Christoph Hellwig , Andrew Morton , Vincent^M^J Sanders , Ingo Molnar Subject: Re: [PATCH] sound_core.c: Remove BKL from soundcore_open Message-ID: <20091011204052.GB5486@nowhere> References: <20091011113317.GA4901@nowhere> <200910111612.41717.oliver@neukum.org> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <200910111612.41717.oliver@neukum.org> User-Agent: Mutt/1.5.18 (2008-05-17) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1392 Lines: 36 On Sun, Oct 11, 2009 at 04:12:40PM +0200, Oliver Neukum wrote: > Am Sonntag, 11. Oktober 2009 14:41:15 schrieb John Kacur: > > @@ -576,8 +576,6 @@ static int soundcore_open(struct inode *inode, struct > > file *file) struct sound_unit *s; > > ????????const struct file_operations *new_fops = NULL; > > ? > > -???????lock_kernel (); > > - > > ????????chain=unit&0x0F; > > ????????if(chain==4 || chain==5)????????/* dsp/audio/dsp16 */ > > ????????{ > > @@ -631,17 +629,17 @@ static int soundcore_open(struct inode *inode, struct > > file *file) file->f_op = new_fops; > > ????????????????spin_unlock(&sound_loader_lock); > > ????????????????if(file->f_op->open) > > +???????????????????????lock_kernel(); > > ????????????????????????err = file->f_op->open(inode,file); > > +???????????????????????unlock_kernel(); > > ????????????????if (err) { > > ????????????????????????fops_put(file->f_op); > > ????????????????????????file->f_op = fops_get(old_fops); > > Is that just me, or is file->f_op unguarded in this version? > > Regards > Oliver Once assigned to file, the new fops won't move again. And won't be freed until fops_put is called. -- 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/