From mboxrd@z Thu Jan 1 00:00:00 1970 From: Takashi Iwai Subject: Re: [PATCH] [updated] pcm: rate: Add capability to pass configuration node to plugins Date: Tue, 21 Feb 2017 15:43:41 +0100 Message-ID: References: <6d7c74b7-da90-5ae9-c355-c6884b2edf09@gmail.com> <7b3c655f-4b7a-e10a-90ff-5cb480332f3f@IEE.org> <3b8cd9c9-8248-b22a-ebb8-dce7d901951d@IEE.org> 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 (mx2.suse.de [195.135.220.15]) by alsa0.perex.cz (Postfix) with ESMTP id 984102666EA for ; Tue, 21 Feb 2017 15:43:42 +0100 (CET) In-Reply-To: <3b8cd9c9-8248-b22a-ebb8-dce7d901951d@IEE.org> List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: alsa-devel-bounces@alsa-project.org Sender: alsa-devel-bounces@alsa-project.org To: Alan Young Cc: alsa-devel@alsa-project.org List-Id: alsa-devel@alsa-project.org On Tue, 21 Feb 2017 15:34:44 +0100, Alan Young wrote: > > + else if (snd_config_get_type(converter) == SND_CONFIG_TYPE_COMPOUND) { > + snd_config_iterator_t i, next; > + snd_config_for_each(i, next, converter) { > + snd_config_t *n = snd_config_iterator_entry(i); > + const char *id; > + snd_config_get_id(n, &id); > + if (strcmp(id, "name") != 0) > + continue; > + snd_config_get_string(n, &type); > + break; > + } > + if (type) { > + err = rate_open_func(rate, type, converter, 1); > + } The error handling is missing when no name is given. You should handle the error explicitly instead of the success. if (!type) { SNDERR("No name is given for rate converter"); ..... return -EINVAL; } err = rate_open_func(....); Takashi