Received: by 2002:a25:824b:0:0:0:0:0 with SMTP id d11csp3673003ybn; Fri, 27 Sep 2019 09:38:10 -0700 (PDT) X-Google-Smtp-Source: APXvYqy4bM97XOSu1SvrypaXFFxU6ixpYvcKVKjX0uP9BiBAsi3lD4+kiRMwrrLbNlW0yG6XQ/7q X-Received: by 2002:a50:ac0a:: with SMTP id v10mr5581473edc.83.1569602290642; Fri, 27 Sep 2019 09:38:10 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1569602290; cv=none; d=google.com; s=arc-20160816; b=qIrlEUetjQ8MUMXbMv0daMVUFC8zLbfyA9BMXqA/z6ofe4mzkyyOQvBfdsbOcAwKqz /RelXfAyZRMrPXlii4LBW1GQDoTl3hKXzsAFuOOO0ax5R2aF4ClajJQTyPbeFKkoM/O3 wsLNu9m6hI1XkuIGEuWb75p+Q4z3hEhTKszRJ0mRtJDrfY3Rpl7Hj30ZvnHUjCuCRbA0 t5vKF3W/bLXvwICRIbm33POAzZ/MCy47I/b+rbGhVd7PueervJZxaLi5pvkMDg90dcX2 QuXCX/NQLCbwlUMBdl91NFhyRyufFtOhx/XNOyW+zcyKQtrFrHrUf85CqBz+YlvAbcJy 2SFw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding :content-language:in-reply-to:mime-version:user-agent:date :message-id:from:references:cc:to:subject; bh=FHYt2Fetnm7Lkb3COkA7ZelT5JQ7B8omooDU3qqWn1Q=; b=e2tsnte8CRTOqMBATqWYnvtXsznNf+tqrc8luqcaM9BjoFHdsoVTgdePyxd4EISUu9 mxDqsuA4ftn5EUc+bzDBi67KCwhI1iT0PNE65YE2YQZRTbLuXvTqdZ4pkb7k+DzY70jG /b6orUL1sxqqTUezEsil+SucUwHrsV+jedMrcxIW4qSHlC4RlzBXhCqGjxpc0o42QC9U UDwsABEhNcu8x4Q0QMc4UvofPhFmuLc86HcE8tDlZinlmbYiWJmPiQHfnLEWwYDgb412 adB+PIi7RBYj/V/hMXaerPHAYaZ7HP+12TCM5WqByZfTQwZwptjgOndT+zj9+sdn0xjQ IZAA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=intel.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id cw11si1525872ejb.245.2019.09.27.09.37.44; Fri, 27 Sep 2019 09:38:10 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727518AbfI0Qh0 (ORCPT + 99 others); Fri, 27 Sep 2019 12:37:26 -0400 Received: from mga09.intel.com ([134.134.136.24]:33225 "EHLO mga09.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726251AbfI0Qh0 (ORCPT ); Fri, 27 Sep 2019 12:37:26 -0400 X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from fmsmga008.fm.intel.com ([10.253.24.58]) by orsmga102.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 27 Sep 2019 09:37:24 -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 Subject: Re: [alsa-devel] [PATCH v2] ASoC: Intel: Skylake: prevent memory leak in snd_skl_parse_uuids To: Andy Shevchenko , Cezary Rojewski Cc: alsa-devel@alsa-project.org, Greg Kroah-Hartman , Jie Yang , Mark Brown , Takashi Iwai , kjlu@umn.edu, Liam Girdwood , emamd001@umn.edu, smccaman@umn.edu, Thomas Gleixner , Enrico Weigelt , linux-kernel@vger.kernel.org, Navid Emamdoost 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-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org > 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?