From patchwork Mon Aug 17 15:14:24 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Greg Kroah-Hartman X-Patchwork-Id: 266119 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=-12.8 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED, DKIM_VALID, HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_PATCH, MAILING_LIST_MULTI, SIGNED_OFF_BY, SPF_HELO_NONE, SPF_PASS, USER_AGENT_GIT autolearn=unavailable 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 1984EC433E1 for ; Mon, 17 Aug 2020 18:55:40 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 012CA20578 for ; Mon, 17 Aug 2020 18:55:40 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1597690540; bh=BuJEaREvInwyPxaAcnGoOa/f2RTigPclr2JZ8rA+a6Q=; h=From:To:Cc:Subject:Date:In-Reply-To:References:List-ID:From; b=c1Iftcw+A3GwA0ewx6lUOA6x4JCNTukCTyE7Oeiad6vjdDBdC6rSu1Ul+jIIqGFr8 Uip9axZ8aFVclymnQ8pgWOPBAavPjv0JrJAtfYTwTKKCxiKpIod8kp+sRdUe6AFyGQ Kcnzl01hfd8tW0orZZrfdtKWCDFzchaRmtSoNEkA= Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2391606AbgHQSz2 (ORCPT ); Mon, 17 Aug 2020 14:55:28 -0400 Received: from mail.kernel.org ([198.145.29.99]:35470 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1730647AbgHQPur (ORCPT ); Mon, 17 Aug 2020 11:50:47 -0400 Received: from localhost (83-86-89-107.cable.dynamic.v4.ziggo.nl [83.86.89.107]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 1B9EB2065C; Mon, 17 Aug 2020 15:50:45 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1597679446; bh=BuJEaREvInwyPxaAcnGoOa/f2RTigPclr2JZ8rA+a6Q=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=n6kd+V9fzYHcYGqZACBeP+I8Se63CFLVFRU9x4U1oW5EUUQBTlqNSWnSnTc25HsCz Zd4NS5sA/lAO0h9IdCP5fzjRtLr5ctkXhkYCeNwQTVUPNT8wjmjWP/kt+CFfTzXOoQ I7tVfLQTXJMr6dE0fAxbAth4peHt8X/+WVf4mFgc= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Jing Xiangfeng , Jerome Brunet , Mark Brown , Sasha Levin Subject: [PATCH 5.7 214/393] ASoC: meson: fixes the missed kfree() for axg_card_add_tdm_loopback Date: Mon, 17 Aug 2020 17:14:24 +0200 Message-Id: <20200817143830.007216996@linuxfoundation.org> X-Mailer: git-send-email 2.28.0 In-Reply-To: <20200817143819.579311991@linuxfoundation.org> References: <20200817143819.579311991@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Sender: stable-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: stable@vger.kernel.org From: Jing Xiangfeng [ Upstream commit bd054ece7d9cdd88e900df6625e951a01d9f655e ] 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 Link: https://lore.kernel.org/r/20200717082242.130627-1-jingxiangfeng@huawei.com Signed-off-by: Mark Brown Signed-off-by: Sasha Levin --- 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 89f7f64747cd0..47f2d93224fea 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;