Received: by 2002:a25:e74b:0:0:0:0:0 with SMTP id e72csp1816446ybh; Fri, 17 Jul 2020 01:47:46 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwlfxXk1ia3De/IhjW7OFexGif72g9adBBhicEXB3dEkxj7bw/lJlJ+njVBp8Ng9hfHNDGc X-Received: by 2002:a17:906:fcc1:: with SMTP id qx1mr7848041ejb.379.1594975666446; Fri, 17 Jul 2020 01:47:46 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1594975666; cv=none; d=google.com; s=arc-20160816; b=eugLdZVyjDhghV1XHcz6HtY5Hi6RMa0OW23CVKvWQwKfMjdTowXs/IMgG17J/v3UO4 XGfQTAJEXTOnYypTPJfg1bKnLkOinXW2RIcE/mleaUvN1aerM5T+SPFeCTJ42MO9LLsi dJNy7xJNSE4gn01u4V5KM2qjiUsB8xeSj9vMe07e170WdiO2IAhlzqls1uiJOPVeD5xD PQYSiiSg3koUkkJ5M0pylMFmArzV91e2KU4W67VjlMkfN6urFSdi59Jcs403EHr6uZK1 M4Sot5aXf4LLoB4C0RRpWOPGgy8H0NIZqGvPnYncVO+k3QBYszFyN6GXr17ZadZ+AC0K mozQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:message-id:date:in-reply-to :subject:cc:to:from:user-agent:references:dkim-signature; bh=9x6fTHZjafmueEMmRdi+LdlMzC2EII5ZkFzc9Fwx204=; b=Zc2HR3nppjTevFuiSnXJTsMdPyY4cEhhGS1gQFTNO+zDI9N1e1xV5M8w57poRw/PdN bV7lpHj+y/FuJl6cZ1/jKMVfezzzhZmtW3acsA0fF6yEakGYRj/a+nW8EGiyortNkUyt ro0tTRKGMqW+0uu8+prq8uwUoKCplndoegkXzYVGi38+8zTCR4d4yjHhZaUnFNbBYDKF YuFzTZu8SeCgUZcFupvLvaQ9sGH2PBjdLOJxapQvb1QCutJd1eZ0QFP2tfV+PrPdSKBf QJvRS2iXszYieblNHs/x5/WpCm2c+cosHdQzZ0R/hokSarVEbHi4ffoxHJ3j8T1Svl3H 9Q6w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@baylibre-com.20150623.gappssmtp.com header.s=20150623 header.b=CcrWH877; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id dk22si4756376edb.289.2020.07.17.01.47.22; Fri, 17 Jul 2020 01:47:46 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@baylibre-com.20150623.gappssmtp.com header.s=20150623 header.b=CcrWH877; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1725970AbgGQIok (ORCPT + 99 others); Fri, 17 Jul 2020 04:44:40 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:47242 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725864AbgGQIoj (ORCPT ); Fri, 17 Jul 2020 04:44:39 -0400 Received: from mail-wr1-x444.google.com (mail-wr1-x444.google.com [IPv6:2a00:1450:4864:20::444]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 73190C061755 for ; Fri, 17 Jul 2020 01:44:39 -0700 (PDT) Received: by mail-wr1-x444.google.com with SMTP id a6so10152950wrm.4 for ; Fri, 17 Jul 2020 01:44:39 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=baylibre-com.20150623.gappssmtp.com; s=20150623; h=references:user-agent:from:to:cc:subject:in-reply-to:date :message-id:mime-version; bh=9x6fTHZjafmueEMmRdi+LdlMzC2EII5ZkFzc9Fwx204=; b=CcrWH877Ri20PNsFBMBPs4KP9jLSBxVMwMQejX+OakrhCpNGurKvg/YYuWyooyngHO PGII9nSP3QITVgwaA4IMlURWO0b7gngGMwk2tXW0Z30dsgpHUZLhxbzH/rTNZ6LaErsg 7bkbz0aMZlBSeE8sWKk1eu+xm6tMvSYt1dz3W5nHlHPy0+YrsvYM20RZqDXAcgy0hIFY IFcZv1BdkCGDXemcAcUKGgqaTS1rWgYSHbLZmWdaW+gVOH6Yvi9Ca51nI3rlF4f4cg4Q 4J6q5a2drV9N+LEkPNNOqAy8bOGoph8gzskNnKVVKah64U9qztXuUs/d7VCVkGxWUC63 2AiQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:references:user-agent:from:to:cc:subject :in-reply-to:date:message-id:mime-version; bh=9x6fTHZjafmueEMmRdi+LdlMzC2EII5ZkFzc9Fwx204=; b=GjIwttUeIHcOTFbYFRD5w8iBY9mfA+yDrebq6VnLEd3Hmwm+ukhVUv9aP0CLj/XWu3 ebrjNv7ULA4KukMh0G9HoQykh2sO9KLvAYmZ0OdhDV51cA6ZmHAM8y6pmXp/hR1xDueK WeQTUh7T78qzaS9wmJTmF8qO+XH7yoJQr6KAndcmc+sgvxJ/GTbRvvuWo2TOFzEYCFrz Gg521owS0t09hdC2/sQ7UpYxFFc0BJ0kbQHOHy58nnhv5Kr7btrsCSoVDlVKY3XUuurp Kt15C+HK/GvQuz776M7LLUOwr3EZpbFxujcI/+ybXeTMLeC/UHYW3ukW3QONOCnV1N4+ aWFw== X-Gm-Message-State: AOAM531ZLS3lqCoyW8YKn430iA6P616zZ4RMmhTe/n1NDsS8OT1thcFe iw38ULr4XNDL+9YStxwNbYSwEQ== X-Received: by 2002:adf:f311:: with SMTP id i17mr9496093wro.237.1594975477992; Fri, 17 Jul 2020 01:44:37 -0700 (PDT) Received: from localhost (laubervilliers-658-1-213-31.w90-63.abo.wanadoo.fr. [90.63.244.31]) by smtp.gmail.com with ESMTPSA id k20sm12480834wmi.27.2020.07.17.01.44.35 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 17 Jul 2020 01:44:35 -0700 (PDT) References: <20200717082242.130627-1-jingxiangfeng@huawei.com> User-agent: mu4e 1.3.3; emacs 26.3 From: Jerome Brunet To: Jing Xiangfeng , lgirdwood@gmail.com, broonie@kernel.org, perex@perex.cz, tiwai@suse.com, khilman@baylibre.com, kuninori.morimoto.gx@renesas.com Cc: alsa-devel@alsa-project.org, linux-arm-kernel@lists.infradead.org, linux-amlogic@lists.infradead.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH v2] ASoC: meson: fixes the missed kfree() for axg_card_add_tdm_loopback In-reply-to: <20200717082242.130627-1-jingxiangfeng@huawei.com> Date: Fri, 17 Jul 2020 10:44:35 +0200 Message-ID: <1j7dv2sf7w.fsf@starbuckisacylon.baylibre.com> MIME-Version: 1.0 Content-Type: text/plain Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri 17 Jul 2020 at 10:22, Jing Xiangfeng wrote: > axg_card_add_tdm_loopback() misses to call kfree() in an error path. We > can use devm_kasprintf() to fix the issue, also improve maintainability. > So use it instead. > > Fixes: c84836d7f650 ("ASoC: meson: axg-card: use modern dai_link style") > Signed-off-by: Jing Xiangfeng Reviewed-by: Jerome Brunet > --- > sound/soc/meson/axg-card.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/sound/soc/meson/axg-card.c b/sound/soc/meson/axg-card.c > index 89f7f64747cd..47f2d93224fe 100644 > --- a/sound/soc/meson/axg-card.c > +++ b/sound/soc/meson/axg-card.c > @@ -116,7 +116,7 @@ static int axg_card_add_tdm_loopback(struct snd_soc_card *card, > > lb = &card->dai_link[*index + 1]; > > - lb->name = kasprintf(GFP_KERNEL, "%s-lb", pad->name); > + lb->name = devm_kasprintf(card->dev, GFP_KERNEL, "%s-lb", pad->name); > if (!lb->name) > return -ENOMEM;