Received: by 2002:a25:e74b:0:0:0:0:0 with SMTP id e72csp1213753ybh; Thu, 16 Jul 2020 06:25:07 -0700 (PDT) X-Google-Smtp-Source: ABdhPJz1YVLdZjt6wYCFR5d4AAgdcktz+NKbOAtknEEtJMRUuAKtqiPj08f2MltHSsdw3O5VUXKH X-Received: by 2002:a50:fe16:: with SMTP id f22mr4461273edt.315.1594905907785; Thu, 16 Jul 2020 06:25:07 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1594905907; cv=none; d=google.com; s=arc-20160816; b=RDBYOD/8gFk+X2BhTdxzDnW6a2dbEKgfU0RInUHdLr3yfm31g298EarptU7RE35hXi aC3kW44QZ8TktWBNf836agnOKNv52r9yHASPMGidE6gNOYKg1azEHX75RglSWLdU6RAN N4lCRTNqUIQtQAzHhfEDI9rLU16yOFtzp3va4z8F4X1gBWFfH6p6tCSA23mAYgWRyoxU U6UIPOR7zFSj4mGVNngBFcVJF3+8dnXM0lGoWXfGuWPTQX2GKK9WgbnKnlG3f7i7eqt7 krQMF+a40r0enelRgtV9yNm0qx9TqKyfWvR3vMCI6At0iURtsJaWJ2EwvfP6LToB6z4k 7cQQ== 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=bRZocIdQqu+FRViuljK9krJyaefobGezx6LGIuTRkSQ=; b=PB3mc6YA+eBYtDRbPx0auK4ON7RoBPgtIFiwwhg2Bn7QF+KAc+MUippR9W2sPpax4h aJQJ+lOMQ6NV8WzNqbId1HRVLiTnVXXeHvdpBCEvcVXr1JId0vBzjELIJVcLxrlITUKY yJcEwXwPIKd3ObjmCmASyfbQBgqXw7+UmYVnmLkp/gQdtYBkBRwpbNKpuJI4ZlnYOW/8 jHXuydBNOpRxgzaBZJHvYiedkdbIeU5BLlThHLFyjEZ9X808U84/ZdFOE/aakmSynwD0 +gwFtL4j3R697g8mubIOOVUWsenAPbkOPuQdKCA1eOwuvLWaONKynT4kOBV+jMKImwIp tkpg== 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 c94si3373384edf.589.2020.07.16.06.24.44; Thu, 16 Jul 2020 06:25:07 -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 S1728260AbgGPNWc (ORCPT + 99 others); Thu, 16 Jul 2020 09:22:32 -0400 Received: from szxga06-in.huawei.com ([45.249.212.32]:59336 "EHLO huawei.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1727044AbgGPNWb (ORCPT ); Thu, 16 Jul 2020 09:22:31 -0400 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: , , , , , , CC: , , , , 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 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. 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