From mboxrd@z Thu Jan 1 00:00:00 1970 From: gsantosh@codeaurora.org Subject: Question on fe_dai_open Date: Fri, 18 Jul 2014 12:11:46 -0000 Message-ID: <24f2c41bc1a9ac326b94ef14ce1bb1bf.squirrel@www.codeaurora.org> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: Received: from smtp.codeaurora.org (smtp.codeaurora.org [198.145.11.231]) by alsa0.perex.cz (Postfix) with ESMTP id 0D3CB2655F3 for ; Fri, 18 Jul 2014 14:17:46 +0200 (CEST) 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: alsa-devel@alsa-project.org Cc: Mark Brown , lgirdwood@gmail.com List-Id: alsa-devel@alsa-project.org Hi All, In the following function dpcm_fe_dai_open Why the code is proceeding further if dpcm_path_get returns zero, if dpcm_path_get returns zero implies there is no vaild path setup. technically we should return from the function when there is no valid path setup, still we proceed further de-referencing the pointer at the exit of this function through dpcm_path_put(&list); please let me know why we are not returning when dpcm_path_get returns zero. static int dpcm_fe_dai_open(struct snd_pcm_substream *fe_substream) { .... if (dpcm_path_get(fe, stream, &list) <= 0) { dev_dbg(fe->dev, "ASoC: %s no valid %s route\n", fe->dai_link->name, stream ? "capture" : "playback"); /*we need to return if there is no vaild paths available*/ } .... dpcm_path_put(&list); } Regards Santosh M G