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=-18.8 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER, INCLUDES_PATCH,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED, URIBL_RED,USER_AGENT_GIT autolearn=ham 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 7576EC433E0 for ; Thu, 7 Jan 2021 14:32:32 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 4BDDE22EBF for ; Thu, 7 Jan 2021 14:32:32 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729232AbhAGOcK (ORCPT ); Thu, 7 Jan 2021 09:32:10 -0500 Received: from mail.kernel.org ([198.145.29.99]:45562 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729205AbhAGOcH (ORCPT ); Thu, 7 Jan 2021 09:32:07 -0500 Received: by mail.kernel.org (Postfix) with ESMTPSA id 8C4D22339E; Thu, 7 Jan 2021 14:31:44 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1610029905; bh=En20DpysjccnEUhLZYpEpegkqk/h9ysP7JUhT0CPKe4=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=W1AJSDELQNedTgt0jecg3pl9+6+9fKd0YcdIE4a4sAaxGJuIq+s3+t5Kuwb8OGgcO Gqi8G1ie2mZ6GBWnebo3bOynOjIRovCyU1/WFCuf30rk7WccTOIRskJt4ODeJzQ2T9 6MaKs1i/gYieRTCst/Ol11813Z+zslYy221fJKJY= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Yu Kuai , Vinod Koul Subject: [PATCH 4.19 4/8] dmaengine: at_hdmac: add missing kfree() call in at_dma_xlate() Date: Thu, 7 Jan 2021 15:32:04 +0100 Message-Id: <20210107143048.159101629@linuxfoundation.org> X-Mailer: git-send-email 2.30.0 In-Reply-To: <20210107143047.586006010@linuxfoundation.org> References: <20210107143047.586006010@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Yu Kuai commit e097eb7473d9e70da9e03276f61cd392ccb9d79f upstream. If memory allocation for 'atslave' succeed, at_dma_xlate() doesn't have a corresponding kfree() in exception handling. Thus add kfree() for this function implementation. Fixes: bbe89c8e3d59 ("at_hdmac: move to generic DMA binding") Signed-off-by: Yu Kuai Link: https://lore.kernel.org/r/20200817115728.1706719-4-yukuai3@huawei.com Signed-off-by: Vinod Koul Signed-off-by: Greg Kroah-Hartman --- drivers/dma/at_hdmac.c | 1 + 1 file changed, 1 insertion(+) --- a/drivers/dma/at_hdmac.c +++ b/drivers/dma/at_hdmac.c @@ -1718,6 +1718,7 @@ static struct dma_chan *at_dma_xlate(str chan = dma_request_channel(mask, at_dma_filter, atslave); if (!chan) { put_device(&dmac_pdev->dev); + kfree(atslave); return NULL; }