From mboxrd@z Thu Jan 1 00:00:00 1970 From: Takashi Iwai Subject: Re: [PATCH] alsa-lib: snd_device_name_hint misbehaving Date: Tue, 03 Nov 2009 08:13:41 +0100 Message-ID: References: <1257128586.16837.29.camel@dark-knight> <1257185541.1937.17.camel@dark-knight> Mime-Version: 1.0 (generated by SEMI 1.14.6 - "Maruoka") Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: Received: from mx2.suse.de (cantor2.suse.de [195.135.220.15]) by alsa0.perex.cz (Postfix) with ESMTP id E702C1037EA for ; Tue, 3 Nov 2009 08:13:41 +0100 (CET) In-Reply-To: <1257185541.1937.17.camel@dark-knight> List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: alsa-devel-bounces@alsa-project.org Errors-To: alsa-devel-bounces@alsa-project.org To: John Lindgren Cc: alsa-devel@alsa-project.org List-Id: alsa-devel@alsa-project.org At Mon, 02 Nov 2009 13:12:21 -0500, John Lindgren wrote: > > On Mon, 2009-11-02 at 07:21 +0100, Jaroslav Kysela wrote: > > On Sun, 1 Nov 2009, John Lindgren wrote: > > > > > * Remove erroneous snd_config_delete calls that cause later calls to > > > snd_pcm_open to fail. > > > > It does not look good. Have you checked with valgrind if there are no > > memory leaks? > > You're making the same mistake that the original author of the code > made. snd_config_delete is not a call to free memory; it is a call to > remove sections of the loaded configuration. The configuration nodes > that were being passed to snd_config_delete were returned by > snd_config_search, which returns direct pointers to the actual nodes in > the configuration. It does no memory duplication. Well, no, the code there should be OK. It's the place to replace the whole sub-tree by overriding the object. Thus, freeing the object returned from snd_config_search() is correct. The problem is rather in namehint.c, as found in my patch in another post. > > Please, split your changes to single patches. Thanks. > > I will do so when I have the time to learn Git a little better. (I > normally use Mercurial). This is easy even without VCS. Just split your own patch to several files by an editor :) Namely, the change of dlmisc.c, and the addition of "ctl" check in namehint.c. thanks, Takashi