From mboxrd@z Thu Jan 1 00:00:00 1970 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=-13.0 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,URIBL_BLOCKED, 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 5EDE0C433E2 for ; Thu, 16 Jul 2020 13:22:50 +0000 (UTC) Received: from merlin.infradead.org (merlin.infradead.org [205.233.59.134]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 2285B2074B for ; Thu, 16 Jul 2020 13:22:50 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="Z5jqhCSo" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 2285B2074B Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=huawei.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-amlogic-bounces+linux-amlogic=archiver.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=merlin.20170209; h=Sender:Content-Transfer-Encoding: Content-Type:Cc:List-Subscribe:List-Help:List-Post:List-Archive: List-Unsubscribe:List-Id:MIME-Version:Message-ID:Date:Subject:To:From: Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From:Resent-Sender :Resent-To:Resent-Cc:Resent-Message-ID:In-Reply-To:References:List-Owner; bh=swO8nyg/d9QTAFyoKop3ZzQdtuXMqySOmCvLJKxTkfc=; b=Z5jqhCSoAm7mZ6bknfVQLzwF7d gwFzDydY6SlZaKFHSmy05zjD2zhME5K2px77qJQHpL6bT0tdd0g57ib3i3ZJ7FudqX+QJyJ3vJP+a 63+miiqqNjx9cPO/qhNBG7NC3w3D2C2ZGZ/tJeq6l1D6y0JCDWFMGAbbDH8dryWLxGTZOTTLVUmWg SmLKvtDCWZHeMEDlpm3PF1P9/zn9q5Fe59/p+PHF+FPxpBsJ8zdJztiPBHhNW3w7IwXffv+qA19HG 4P+UUyO7AHKVUTUSxZT+Se7MChlVEj/7Z2CUSOiPsP6iv0Vw8SN1quBedQf1w7ZPJq8Hfr7eLPG4i IK341b8w==; Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1jw3qV-0006Uz-SL; Thu, 16 Jul 2020 13:22:43 +0000 Received: from szxga06-in.huawei.com ([45.249.212.32] helo=huawei.com) by merlin.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1jw3qT-0006Tv-9Q; Thu, 16 Jul 2020 13:22:42 +0000 Received: from DGGEMS403-HUB.china.huawei.com (unknown [172.30.72.59]) by Forcepoint Email with ESMTP id E1ACDF1C77EE7C3B6E82; Thu, 16 Jul 2020 21:22:29 +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; Thu, 16 Jul 2020 21:22:22 +0800 From: Jing Xiangfeng To: , , , , , , Subject: [PATCH] ASoC: meson: add the missed kfree() for axg_card_add_tdm_loopback Date: Thu, 16 Jul 2020 21:25:58 +0800 Message-ID: <20200716132558.33932-1-jingxiangfeng@huawei.com> X-Mailer: git-send-email 2.20.1 MIME-Version: 1.0 X-Originating-IP: [10.175.113.25] X-CFilter-Loop: Reflected X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20200716_092241_574010_CF8D7EAF X-CRM114-Status: UNSURE ( 7.85 ) X-CRM114-Notice: Please train this message. X-BeenThere: linux-amlogic@lists.infradead.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: linux-amlogic@lists.infradead.org, alsa-devel@alsa-project.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, jingxiangfeng@huawei.com Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-amlogic" Errors-To: linux-amlogic-bounces+linux-amlogic=archiver.kernel.org@lists.infradead.org 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 --- 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]; -- 2.17.1 _______________________________________________ linux-amlogic mailing list linux-amlogic@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-amlogic