Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp1833871imu; Thu, 10 Jan 2019 03:57:03 -0800 (PST) X-Google-Smtp-Source: ALg8bN7yw9ANVubut+dg/uFIB5CF0kWY6wHC1AqfR8I2rNWyQBbjLoN7cufnwCt/L7MNBn+nSUYF X-Received: by 2002:a63:5723:: with SMTP id l35mr8812245pgb.228.1547121423584; Thu, 10 Jan 2019 03:57:03 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1547121423; cv=none; d=google.com; s=arc-20160816; b=fu0aVnclbGaZpiIXRVe5DLbEwHLN8C3OT3c+bUP0u6UP9R4ZWSECs0g9A/roktzQjN Eke2aU/Pj2bHaJ9aEzAXb1YG84zOJu8tsFvX07ZugTHYBswjD3tTt3Y5xmMb+qj99rnM e6dDnyZ+eCqjQT73BwphOe9tGkW3bxtkhh+lesm3+3N5u5neaiSdNuH50vF+T0JuUItm uPfd3Ngi4rmOmlAMUZMXS2C9P9U2RfS0+x3UQGsh2Sh376uN1oe+Low0ndpkJg1SP+n5 t4yDJAlWJcl3s028A0564GCDRD+Imz7qNrjOtpNH/8e1EoNg1/Ir5mRVEPE4sLrx3gDg wnAA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:dkim-signature:content-transfer-encoding :content-language:in-reply-to:mime-version:user-agent:date :message-id:from:references:cc:to:subject; bh=j//TMwjSKzY2Aan2YwqJW8hR5guLjV9iJNrcK6jvCwU=; b=WaeJ5uFgY+Ao/w9q97OtAqXOoXAdkNDYavlbOfBCpmAfHxVi+kSlj4CQZwWPNS9M8Z tFdRM7ukaq60O7KK253d6B1guNm0fm8SHPA8vsukKYJW0nbGWQcKD8b43fB/mU2ufW8f clb/axCG7Nq4ohSldX11ptwdZgGe55AhhjOoppiozW25xBWwbgJf5473IMisBCHgqXmN ziDd066Pjitd8b3DgMUjmtBJlAgfHw4CNEIyPnTD4n1DyGLtPQD1sgBpjm5AvkcjiT0l ip0v7s/Fs6aNCzy02S4Cbyj6AuUrHPiTr5pKChwhkLliLH0WRPufTo99ehitnlwGNvne xsnA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@nvidia.com header.s=n1 header.b=jyH0m92B; 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=pass (p=NONE sp=NONE dis=NONE) header.from=nvidia.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id 33si34315720plg.62.2019.01.10.03.56.48; Thu, 10 Jan 2019 03:57:03 -0800 (PST) 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; dkim=pass header.i=@nvidia.com header.s=n1 header.b=jyH0m92B; 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=pass (p=NONE sp=NONE dis=NONE) header.from=nvidia.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728088AbfAJK4k (ORCPT + 99 others); Thu, 10 Jan 2019 05:56:40 -0500 Received: from hqemgate15.nvidia.com ([216.228.121.64]:10109 "EHLO hqemgate15.nvidia.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727455AbfAJK4j (ORCPT ); Thu, 10 Jan 2019 05:56:39 -0500 Received: from hqpgpgate102.nvidia.com (Not Verified[216.228.121.13]) by hqemgate15.nvidia.com (using TLS: TLSv1.2, DES-CBC3-SHA) id ; Thu, 10 Jan 2019 02:56:21 -0800 Received: from hqmail.nvidia.com ([172.20.161.6]) by hqpgpgate102.nvidia.com (PGP Universal service); Thu, 10 Jan 2019 02:56:39 -0800 X-PGP-Universal: processed; by hqpgpgate102.nvidia.com on Thu, 10 Jan 2019 02:56:39 -0800 Received: from [10.21.132.148] (10.124.1.5) by HQMAIL101.nvidia.com (172.20.187.10) with Microsoft SMTP Server (TLS) id 15.0.1395.4; Thu, 10 Jan 2019 10:56:37 +0000 Subject: Re: [alsa-devel] [PATCH v1 3/3] ASoC: soc-core: fix platform name vs. of_node assignement To: Kuninori Morimoto , Mark Brown CC: Liam Girdwood , , Matthias Reichl , , Marcel Ziswiler , Takashi Iwai , , Marcel Ziswiler References: <20181218174040.k7u26vnnoplllnwb@camel2.lan> <952471da-b355-6471-6c19-5120d6704f81@nvidia.com> <87lg3vuc7p.wl-kuninori.morimoto.gx@renesas.com> <865d2a3e-bf6b-1f30-1179-7e922c0d0641@nvidia.com> <87k1je38w7.wl-kuninori.morimoto.gx@renesas.com> <0660a471-3698-2059-4494-ad146518a4ed@nvidia.com> <20190109125340.GD10405@sirena.org.uk> <52f5f2cf-9260-f9c5-f73d-3c3d5debc86b@nvidia.com> <20190109141439.GE10405@sirena.org.uk> <875zuxb9uy.wl-kuninori.morimoto.gx@renesas.com> From: Jon Hunter Message-ID: Date: Thu, 10 Jan 2019 10:56:35 +0000 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.2.1 MIME-Version: 1.0 In-Reply-To: <875zuxb9uy.wl-kuninori.morimoto.gx@renesas.com> X-Originating-IP: [10.124.1.5] X-ClientProxiedBy: HQMAIL104.nvidia.com (172.18.146.11) To HQMAIL101.nvidia.com (172.20.187.10) Content-Type: text/plain; charset="utf-8" Content-Language: en-US Content-Transfer-Encoding: 7bit DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nvidia.com; s=n1; t=1547117781; bh=j//TMwjSKzY2Aan2YwqJW8hR5guLjV9iJNrcK6jvCwU=; h=X-PGP-Universal:Subject:To:CC:References:From:Message-ID:Date: User-Agent:MIME-Version:In-Reply-To:X-Originating-IP: X-ClientProxiedBy:Content-Type:Content-Language: Content-Transfer-Encoding; b=jyH0m92BMIG1W6gmvbQ1pZwNRNyDOhbbzn/uZz24LoTltIWkQsevv/AR2J0DD/Zsi 20PCjDpCbipHuyNAl9q6tQ7PtrI4T8BR/OIZXjoHxkJPMQWJJ2W+6gV9GYJ9LA3892 UlIANDLeVdXGRdqKcWWTktOv7/vUdMzN171mzQQYoo49YtPKgVIzQ4awWasdducCom a/Ip4pSsCG6b0qz8PdSz+LB+WuQ1+VIW4voZivUWGxl/kckT+hYJAFONztrDTJ82iD ZeLUY0cMmr3+aBxe1vZE736TSblnt+f+GzGXsvpDC0Cx2/tq5ricYWtL5AgdneDRwq B5QSCntZ07WDA== Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 10/01/2019 01:16, Kuninori Morimoto wrote: ... > As I mentioned above, I think we have same issue on codec side too. Actually no. Looking at snd_soc_init_multicodec() it always allocates memory if any of the 'legacy' codec members (codec_name/codec_of_node/codec_dai_name) are populated. However, this looks quite fragile to me and is susceptible to leaking memory if the user/machine driver already incorrectly allocated the memory as well as populating these legacy codec members. My concern about all of this is it is not fool proof and hard to detect if a machine driver is doing something bad that it should not. > exchanging *platform to platform doesn't solve all issues. > And we need to exchange all driver again if we had multi-platform > support in the future (I don't know when it can happen though...) > > My posted quick-patch can solve "dirty pointer" issue, > but it can't solve "memory leak" issue. > This issue will be solved if all driver can switch to > modern style, but it needs more time. > Are these correct ? > > So, how about this ? It is still fragile. Again the machine driver could have incorrectly set these 'allocated_platform/codecs' members as they are exposed to the machine driver. You have no way to determine if the machine driver is doing the correct thing or not. The problem becomes more complex with probe deferral. Cheers Jon -- nvpublic