From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-2.2 required=3.0 tests=DKIM_SIGNED,DKIM_VALID, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS, URIBL_BLOCKED,USER_AGENT_SANE_1 autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 272EFC4360C for ; Fri, 27 Sep 2019 16:38:26 +0000 (UTC) Received: from alsa0.perex.cz (alsa0.perex.cz [77.48.224.243]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 26DB421841 for ; Fri, 27 Sep 2019 16:38:25 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=alsa-project.org header.i=@alsa-project.org header.b="Kn8ZFpO3" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 26DB421841 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=linux.intel.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=alsa-devel-bounces@alsa-project.org Received: from alsa1.perex.cz (alsa1.perex.cz [207.180.221.201]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by alsa0.perex.cz (Postfix) with ESMTPS id F14A615E4; Fri, 27 Sep 2019 18:37:32 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa0.perex.cz F14A615E4 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=alsa-project.org; s=default; t=1569602303; bh=X5nHxTxwV8EazKxYKZTaicl68S2JYJVaISvZXHEiHb0=; h=To:References:From:Date:In-Reply-To:Cc:Subject:List-Id: List-Unsubscribe:List-Archive:List-Post:List-Help:List-Subscribe: From; b=Kn8ZFpO37mg3ZZPr0E6SwBvcoNv5x0PIJj7wqTic+X74GG3rnzM2B/hUxdX9oLsLY xcvbG6A9m3s5DDuC5A7O7PWIaUXW7c5OuWqplFPAR/9UcQvWTRbgshF0bfs1N6iYCa dKhLmHYA0WL5KUZ4r4vJI1pG8IrtYx+A3DxP3954= Received: from alsa1.perex.cz (localhost.localdomain [127.0.0.1]) by alsa1.perex.cz (Postfix) with ESMTP id 7F637F800B3; Fri, 27 Sep 2019 18:37:32 +0200 (CEST) Received: by alsa1.perex.cz (Postfix, from userid 50401) id E99F4F8049A; Fri, 27 Sep 2019 18:37:30 +0200 (CEST) Received: from mga05.intel.com (mga05.intel.com [192.55.52.43]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by alsa1.perex.cz (Postfix) with ESMTPS id EA568F80138 for ; Fri, 27 Sep 2019 18:37:27 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa1.perex.cz EA568F80138 X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from fmsmga008.fm.intel.com ([10.253.24.58]) by fmsmga105.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 27 Sep 2019 09:37:25 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.64,556,1559545200"; d="scan'208";a="189493023" Received: from sanyamba-mobl.amr.corp.intel.com (HELO [10.254.4.17]) ([10.254.4.17]) by fmsmga008.fm.intel.com with ESMTP; 27 Sep 2019 09:37:24 -0700 To: Andy Shevchenko , Cezary Rojewski References: <20190925161922.22479-1-navid.emamdoost@gmail.com> <13f4bd40-dbaa-e24e-edca-4b4acff9d9c5@linux.intel.com> <20190927025526.GD22969@cs-dulles.cs.umn.edu> <6966df25-e82c-1abe-6a0f-ff497dcda23b@intel.com> <20190927153304.GS32742@smile.fi.intel.com> From: Pierre-Louis Bossart Message-ID: <2e8ef4df-9c5f-f6e0-23ee-32d3bc555330@linux.intel.com> Date: Fri, 27 Sep 2019 11:37:24 -0500 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.8.0 MIME-Version: 1.0 In-Reply-To: <20190927153304.GS32742@smile.fi.intel.com> Content-Language: en-US Cc: alsa-devel@alsa-project.org, Greg Kroah-Hartman , kjlu@umn.edu, Jie Yang , Takashi Iwai , Liam Girdwood , Mark Brown , smccaman@umn.edu, Thomas Gleixner , Navid Emamdoost , Enrico Weigelt , linux-kernel@vger.kernel.org, emamd001@umn.edu Subject: Re: [alsa-devel] [PATCH v2] ASoC: Intel: Skylake: prevent memory leak in snd_skl_parse_uuids X-BeenThere: alsa-devel@alsa-project.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: "Alsa-devel mailing list for ALSA developers - http://www.alsa-project.org" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset="us-ascii"; Format="flowed" Errors-To: alsa-devel-bounces@alsa-project.org Sender: "Alsa-devel" > The problem with solution #1 is freeing orphaned pointer. It will work, > but it's simple is not okay from object life time prospective. ?? I don't get your point at all Andy. Two allocations happens in a loop and if the second fails, you free the first and then jump to free everything allocated in the previous iterations. what am I missing? _______________________________________________ Alsa-devel mailing list Alsa-devel@alsa-project.org https://mailman.alsa-project.org/mailman/listinfo/alsa-devel