Received: by 2002:a25:e74b:0:0:0:0:0 with SMTP id e72csp1805075ybh; Fri, 17 Jul 2020 01:22:06 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxye3HFzuYQXz09wOMlVpHdhLxzLaFNjJF0w8Fjvl8uUA1xFN254KmITP0jT8NroM4mCmzh X-Received: by 2002:a17:906:c187:: with SMTP id g7mr5399257ejz.108.1594974126413; Fri, 17 Jul 2020 01:22:06 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1594974126; cv=none; d=google.com; s=arc-20160816; b=Fxi+0Qmi8XLW768VCdpNdFbTp/zdGwPnJnJ8ZfPUYhmLJiLxBP+AGOW1rnWkCNBMeG iSMPNqZag/Qx5t12RxAS4tBkF74/Ew5q7GcNaD89Sz/LOyGSENxm5TpmEJxrRpXo+v00 2B0llgXEtybLE5Mz2rzNzUIUubKhm0X+Efj6W1+aMYnPvYQebs4CU2LDcNqpa7nFozrp Vl+zZU7MZIO6cnHEbyOsS48ctHj3gsWS6rWIiwCdnrPjWokAP5DE30Ex60OIcMoXfyzu c+kFXXkBZrcFw6oT7U84N/gIrPwjHZRbsgRjPpDN1hpQd6xpHg1osvRfOGMlDbptzgOS kQtA== 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:mime-version :message-id:date:subject:cc:to:from; bh=NjyfAZnV3V+YpmarIh30lmrdEzcXiJgirdf0QNbV8MY=; b=HThwsj81NRjdrsA2PeW0Q9XAjvghTbVgtCI8MWHs6vJVuzfABmqrTbcZZTT6vZb+Vs gZ/tTi5PseMFCQZKTMcwpzi2OKn3c0EjE8Xm+nSOhMrf0axYGOHMzTiGNWUMw62ur3SE mC6iR8qcaUGjVLtuAKlqK+bAogx/ofpukCviyw9G4PZx47KlmEtq/f9OmSSsmwIBe5Qo 6qcOKu9eXbe3mlRgAd8dthZA1jRrXBxKgufx3Vm0fnqTdQmobA/fmoDcvkO+nw1Tu6Ff C3ws4LzM+7MKL9hMA4dOwf/FYIOt8Ulj2HEljsqcHzHrZ78aKW8pr4ddD+QBy5jEDaxa sxWw== ARC-Authentication-Results: i=1; mx.google.com; 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 mm15si4438120ejb.561.2020.07.17.01.21.44; Fri, 17 Jul 2020 01:22:06 -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; 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 S1728268AbgGQITa (ORCPT + 99 others); Fri, 17 Jul 2020 04:19:30 -0400 Received: from szxga04-in.huawei.com ([45.249.212.190]:8313 "EHLO huawei.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1726240AbgGQIT3 (ORCPT ); Fri, 17 Jul 2020 04:19:29 -0400 Received: from DGGEMS403-HUB.china.huawei.com (unknown [172.30.72.59]) by Forcepoint Email with ESMTP id 536C352A645CA3F5BF09; Fri, 17 Jul 2020 16:19:10 +0800 (CST) Received: from localhost.localdomain.localdomain (10.175.113.25) by DGGEMS403-HUB.china.huawei.com (10.3.19.203) with Microsoft SMTP Server id 14.3.487.0; Fri, 17 Jul 2020 16:19:02 +0800 From: Jing Xiangfeng To: , , , , , , CC: , , , , Subject: [PATCH v2] ASoC: meson: fixes the missed kfree() for axg_card_add_tdm_loopback Date: Fri, 17 Jul 2020 16:22:42 +0800 Message-ID: <20200717082242.130627-1-jingxiangfeng@huawei.com> X-Mailer: git-send-email 2.20.1 MIME-Version: 1.0 Content-Transfer-Encoding: 7BIT Content-Type: text/plain; charset=US-ASCII X-Originating-IP: [10.175.113.25] X-CFilter-Loop: Reflected Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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 --- 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; -- 2.17.1