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=-14.0 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER, INCLUDES_PATCH,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED 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 87C9EC433E0 for ; Mon, 4 Jan 2021 11:02:31 +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 3F7CF207BC for ; Mon, 4 Jan 2021 11:02:31 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 3F7CF207BC Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=linuxfoundation.org Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+linux-arm-kernel=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:In-Reply-To:MIME-Version:References:Message-ID: Subject:To:From:Date:Reply-To:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=tPlWWjdAZTe9jtUCRm7uZWEyn1kTFEYmsqSdJa/qvcE=; b=3XibwoHRgke5Y12Uwt6CDzNms OzucYmvb2SvnmFEJfP1Ub/twamE+79QFGonz6wYjVG7sjaMtpiHkbUq3s0koJg7Wpcr2IwSzM0BUR 3UJXhpO9BTgktOxshNtzRY5VC3CL/g7VDkFrPz6phZmJsaf/0f0U3Eb33Krk1TFBp/JTnEbTUPL4L LQvFTvAkGf5smHe6f80Kqo/QBrCHFQXviQXepelB8U8IQg+oXGF280I8J5JKfR3xIi5aYBneTcQTe LQHI07gphTK2YWYtLIrwEteb2lIl+Gy4co7RPhoq4SmotT/EafogzjMROlZ754rwA+sYmGmUJKKmT rgBPMqcNw==; Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1kwNbr-0006E0-Eb; Mon, 04 Jan 2021 11:01:11 +0000 Received: from mail.kernel.org ([198.145.29.99]) by merlin.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1kwNbo-0006C9-8X for linux-arm-kernel@lists.infradead.org; Mon, 04 Jan 2021 11:01:09 +0000 Received: by mail.kernel.org (Postfix) with ESMTPSA id D185E207BC; Mon, 4 Jan 2021 11:01:06 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1609758067; bh=FQj1a4rL7iltwr5MqltKp3e514hPbhBndFEkl5LtX3w=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=Cy5n5Pj/MdtkAB+OCBYxr9O9TzdNMSCOoD/SphCZZnso0dbrt6j6KkAIWECtvOpZ3 mefMbVXMCQ0Z1o1X17FUcQ2t+wmyXl/i0O+5EbO7c8eAUUbMmwYXQwhWuL2ekE+CsA wghPhcvMtDfBB3n4/W6iOFUQrw3Mu+D7/RxsL458= Date: Mon, 4 Jan 2021 12:02:33 +0100 From: Greg KH To: Tudor.Ambarus@microchip.com Subject: Re: [PATCH 4.19] dmaengine: at_hdmac: Fix memory leak Message-ID: References: <20200920082838.GA813@amd> <80065eac-7dce-aadf-51ef-9a290973b9ec@microchip.com> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20210104_060108_390271_1A7F2C15 X-CRM114-Status: GOOD ( 21.24 ) X-BeenThere: linux-arm-kernel@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-kernel@vger.kernel.org, stable@vger.kernel.org, vkoul@kernel.org, Ludovic.Desroches@microchip.com, pavel@ucw.cz, dmaengine@vger.kernel.org, dan.j.williams@intel.com, linux-arm-kernel@lists.infradead.org Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org On Wed, Sep 23, 2020 at 08:19:18AM +0000, Tudor.Ambarus@microchip.com wrote: > On 9/23/20 11:13 AM, Tudor.Ambarus@microchip.com wrote: > > Hi, Pavel, > > > > On 9/20/20 11:28 AM, Pavel Machek wrote: > >> EXTERNAL EMAIL: Do not click links or open attachments unless you know the content is safe > >> > >> This fixes memory leak in at_hdmac. Mainline does not have the same > >> problem. > >> > >> Signed-off-by: Pavel Machek (CIP) > >> > >> diff --git a/drivers/dma/at_hdmac.c b/drivers/dma/at_hdmac.c > >> index 86427f6ba78c..0847b2055857 100644 > >> --- a/drivers/dma/at_hdmac.c > >> +++ b/drivers/dma/at_hdmac.c > >> @@ -1714,8 +1714,10 @@ static struct dma_chan *at_dma_xlate(struct of_phandle_args *dma_spec, > >> atslave->dma_dev = &dmac_pdev->dev; > >> > >> chan = dma_request_channel(mask, at_dma_filter, atslave); > >> - if (!chan) > >> + if (!chan) { > >> + kfree(atslave); > >> return NULL; > >> + } > > > > Thanks for submitting this to stable. While the fix is good, you can instead > > cherry-pick the commit that hit upstream. In order to do that cleanly on top > > of v4.19.145, you have to pick two other fixes: > > > > commit a6e7f19c9100 ("dmaengine: at_hdmac: Substitute kzalloc with kmalloc") > > commit 3832b78b3ec2 ("dmaengine: at_hdmac: add missing put_device() call in at_dma_xlate()") > > commit a6e7f19c9100 ("dmaengine: at_hdmac: Substitute kzalloc with kmalloc") > > this last commit should have been > commit e097eb7473d9 ("dmaengine: at_hdmac: add missing kfree() call in at_dma_xlate()") > > bad copy and paste :) So are all 3 of those needed on both 5.4.y and 4.19.y to resolve this issue? thanks, greg k-h _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel