Received: by 2002:a25:e74b:0:0:0:0:0 with SMTP id e72csp1219079ybh; Thu, 16 Jul 2020 06:32:32 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyOnDEu+UEf7PIbQbEKlLbsIk/PklWjUnf+3v0+U5M9ALrfgaXTg1DBOUInj2v9BP7zpCIS X-Received: by 2002:a17:906:c1d8:: with SMTP id bw24mr3644609ejb.91.1594906352543; Thu, 16 Jul 2020 06:32:32 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1594906352; cv=none; d=google.com; s=arc-20160816; b=AAW4QX6ElFtvp8EW7OMupkgPmPaj2xNT9gxbRBI8ARBBJNH+bPg9JTaEikD9ceUNhh uknIYE0jlXZYWc9FwcRDJd3xKpNQ0MC6MEEqD47150TNR+LuIlSJlov4807lW4Q9HWlg 4w+CIgXDpkCzmIWp6IZt8XMV/ycNmlAOMr7yp+6EJTP38J8waB+bvtCoVy2gnB8ZEKl5 J7Q0lsWIwNbDBa0i1BfLLjfTu6F8KSikfpOPuvNQpKBW7N7DfO/2TBt7TmMEa9IfWP/F irifvAHs6Q7oKY4HphKkmFm7u/riLRQfXoe2UdZ6EkQjZ/dWG1lk3aSsxHj5/6JzFSQc f8hQ== 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=ekSSt/5t2jmT5g2LzLm9iiouocorbUPUaL0+PSkZByk=; b=Rt46cH6HmoLSQd7OcKsqyfb6Y3FZEppxhcr7KCE5EgB7QQvoyY2Y+R9ul2UQz7vdG2 6mfMaoY9SqLAYFi49RcFzpBshEsQ6ebZTMrQXYEemKNIvUSREO62wPAH4nhnpY7wcKrJ 8cPOfWKGesTbIdlf2QJwb9auV9k8efAkcGo4TeiqrQmA9vYhfWZ3fZr2Y7A/Qf0jaJrU 7ZttqzGrUhLhqQGQxQICI5FAl0ykNZ4qAWU/h58ptzXfaWbOWZDlwnvA2KbXnsX8QYM3 A6AGoK1dNHn1zzTRXKbTXLPfzXZTo3s3z6hJfSW3ncwjC7cF1s/aX+hBfylBWws3jRro 3EXw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@baylibre-com.20150623.gappssmtp.com header.s=20150623 header.b=e4FEY+O3; 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 s5si2999417ejx.28.2020.07.16.06.32.07; Thu, 16 Jul 2020 06:32:32 -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=e4FEY+O3; 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 S1728163AbgGPN3m (ORCPT + 99 others); Thu, 16 Jul 2020 09:29:42 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:38366 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725975AbgGPN3m (ORCPT ); Thu, 16 Jul 2020 09:29:42 -0400 Received: from mail-wm1-x343.google.com (mail-wm1-x343.google.com [IPv6:2a00:1450:4864:20::343]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id E67ACC061755 for ; Thu, 16 Jul 2020 06:29:41 -0700 (PDT) Received: by mail-wm1-x343.google.com with SMTP id 22so10311433wmg.1 for ; Thu, 16 Jul 2020 06:29:41 -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=ekSSt/5t2jmT5g2LzLm9iiouocorbUPUaL0+PSkZByk=; b=e4FEY+O3MN9kneCWpjw2AuA6M3EOeHa76eTJCimRqpdrtKBQSSOraxPXNbBS8f8Hzc tz6zo/FvGqILsjj+bkWDfBySfy7EQhsxQfhljSHeGFQUXL1R14dAuoybNl747hLEjDPY vNppE3yDsKtFgZlvE7vJe6drtvYw7kI2pOfy2MRc5OuRRPF1FSQ8K8uCJQgeihxxobQi QVzUMhFg6KbZManF2vD441ml3dsS6g5yEkZFsIp/v/x1LiDzvlWdzu0jxI4KmMVzVDtZ mvFloFDMjuuzLmqzI356WyXrn6UiezpZ3f74qnVUym5bzdrugxI4+QulkFaW1qEiGlH3 oUmQ== 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=ekSSt/5t2jmT5g2LzLm9iiouocorbUPUaL0+PSkZByk=; b=P4Pm1Z/8cms23Ggswj/XOPjoqTmzczg8xcNnP9uXLgDAjGZLzllRPxhm3Y2xriLRhZ 6qfldVJVctiIseVcMT9W1+EeMjIiWLA9mJMkl8GuWjNbgjvCuKojt/sRFBiRjBDcWNG5 BhHBnTz5jLTcIBJCdwR0KM5Teo60+7yaVVBW7a3kb5/CbIBjmiK7gcCG+5Qb9Ho5fSWA 6jcNy4LfpqbJuGGsoPFbElWeym6e+ARtd8S9IBOeq8imCEQs7Mlzm3J7cIV9UHFFMLiC qYMqOQS7pohzZVEdvo7occzH2g/7xBuYY5IWlGqZF81gtTzrEJT6XvbG4ox+m1cKiq57 sWpQ== X-Gm-Message-State: AOAM533sHuYlCrg8tiX7rcsu1AYbuGhKL4BUH4fkacj+9NAQ88aYQPs0 93DWZHw+hIGdWcJ2P2z+Xkd+wg== X-Received: by 2002:a1c:4c0a:: with SMTP id z10mr4618549wmf.38.1594906180632; Thu, 16 Jul 2020 06:29:40 -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 x7sm8945595wrr.72.2020.07.16.06.29.39 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 16 Jul 2020 06:29:39 -0700 (PDT) References: <20200716132558.33932-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] ASoC: meson: add the missed kfree() for axg_card_add_tdm_loopback In-reply-to: <20200716132558.33932-1-jingxiangfeng@huawei.com> Date: Thu, 16 Jul 2020 15:29:39 +0200 Message-ID: <1jzh7zegfw.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 Thu 16 Jul 2020 at 15:25, Jing Xiangfeng wrote: > axg_card_add_tdm_loopback() misses to call kfree() in an error path. Add > the missed function call to fix it. > > Fixes: c84836d7f650 ("ASoC: meson: axg-card: use modern dai_link style") > Signed-off-by: Jing Xiangfeng Thanks for fixing this. Maybe it would be better to use the devm_ variant for the name instead ? > --- > sound/soc/meson/axg-card.c | 4 +++- > 1 file changed, 3 insertions(+), 1 deletion(-) > > diff --git a/sound/soc/meson/axg-card.c b/sound/soc/meson/axg-card.c > index 89f7f64747cd..6eac22ba8b99 100644 > --- a/sound/soc/meson/axg-card.c > +++ b/sound/soc/meson/axg-card.c > @@ -121,8 +121,10 @@ static int axg_card_add_tdm_loopback(struct snd_soc_card *card, > return -ENOMEM; > > dlc = devm_kzalloc(card->dev, 2 * sizeof(*dlc), GFP_KERNEL); > - if (!dlc) > + if (!dlc) { > + kfree(lb->name); > return -ENOMEM; > + } > > lb->cpus = &dlc[0]; > lb->codecs = &dlc[1];