From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751783AbWI1KIh (ORCPT ); Thu, 28 Sep 2006 06:08:37 -0400 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1751794AbWI1KIh (ORCPT ); Thu, 28 Sep 2006 06:08:37 -0400 Received: from cantor2.suse.de ([195.135.220.15]:30888 "EHLO mx2.suse.de") by vger.kernel.org with ESMTP id S1751783AbWI1KIh (ORCPT ); Thu, 28 Sep 2006 06:08:37 -0400 Date: Thu, 28 Sep 2006 12:08:35 +0200 Message-ID: From: Takashi Iwai To: Karsten Wiese Cc: mingo@elte.hu, alsa-devel@lists.sourceforge.net, linux-kernel@vger.kernel.org Subject: Re: [PATCH] Reset file->f_op in snd_card_file_remove() In-Reply-To: <200609272127.51980.annabellesgarden@yahoo.de> References: <200609272127.51980.annabellesgarden@yahoo.de> 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 MULE XEmacs/21.5 (beta25) (eggplant) (+CVS-20060326) (i386-suse-linux) MIME-Version: 1.0 (generated by SEMI 1.14.6 - "Maruoka") Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org X-Mailing-List: linux-kernel@vger.kernel.org At Wed, 27 Sep 2006 21:27:51 +0200, Karsten Wiese wrote: > > Hi > > This patch helps prevent an oops on 2.6.18-rt3, > when my usb usx2y soundcard disconnects. > Physically disconnects or "rmmod uhci_hc" both oops 1in7. > > With this patch still no oops after > 1000 disconnects. > > Please apply/comment. > > thanks, > Karsten > > === > > Reset file->f_op in snd_card_file_remove() > > When passing here in response to an usb disconnect, > file->f_op has been replaced with a kmalloc()ed version, > that would only allow releases. > > It will be free()ed later on in snd_card_free(). > Here it happened sometimes, that the free()ed, not NULLed file->f_op > caused an oops in module_put() called by fops_put() still later on. > > Signed-off-by: Karsten Wiese snd_card_file_remove() is not a right place to do that, IMO. Could you check whether this problem still happens on post-2.6.18? There are a lot of fixes in this area after 2.6.18. Takashi > > > > --- rt3/sound/core/init.c 2006-09-23 20:03:18.000000000 +0200 > +++ rt3-kw/sound/core/init.c 2006-09-27 20:44:54.000000000 +0200 > @@ -722,6 +722,7 @@ int snd_card_file_remove(struct snd_card > mfile = card->files; > while (mfile) { > if (mfile->file == file) { > + file->f_op = NULL; > if (pfile) > pfile->next = mfile->next; > else > > > > > > ___________________________________________________________ > Der frühe Vogel fängt den Wurm. Hier gelangen Sie zum neuen Yahoo! Mail: http://mail.yahoo.de >