Received: by 2002:a05:6a10:22f:0:0:0:0 with SMTP id 15csp185809pxk; Tue, 22 Sep 2020 23:43:15 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzpN4VpcqS9foZJKC+Upm0ji3xWw8NYrhcTqCF7cELYw1t02GbEDVnj6edTbUSkjWpx4oR6 X-Received: by 2002:aa7:d891:: with SMTP id u17mr7934069edq.188.1600843395752; Tue, 22 Sep 2020 23:43:15 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1600843395; cv=none; d=google.com; s=arc-20160816; b=zXuAjhomYkOK/F2EAAUJJ7XanBZxN1+2dHYIjAJ9rCJa9Ay9skRy2rf/gMMtRyvs/Q Ctwst0YvRa6wgponu+IiqCfZ0sMkVQDldRmzFIQxuln9us38lk8ffo2edFlM8h8kBFU9 ANiD+Bc8FN/GTYnN1lTnBQYJH4ocf/3wwDxiUeMmErr5nDVlyYNZmWSewW8Y2DXCjjjP dZydmwVZ9L1NI+F6k/MUU+CSO6A15otRhvioX7S0ZBteXi7sq8pLyBsIsSG6VHRnjoQi 0n13C04HC9dPT7bqcQAp5Ny47Yowk7b9PKf8sBIlQJqqiZinKTl68XAscgzqUb8/URYi SBjw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date; bh=QFJX5/GdFRrjOZJadtoBBXwCXHJo6BkM7pLd+pg14A4=; b=qIt0qt7xfGXSI5pgOdHRE1fOdQIZd15YiDvjs5J2SOFeeWBhUrqrFICl+eCPImt0U4 mKKHy3VvhGH80NSAa3Bu5Pz31u4lwxp9aVp/JBbDMMYJIqIB6KvOJKtG+oohDpqae4Lp XVDd1pPuRj8eD4Oc6flWjHV9/NfcLTgOH8kBI2Ns+y9YLLyoLNgjeKj29jMXmnM+b2vs DpTcaSqMER8z+jxJ/86brAUyQJekrm0SOgWn5LvnLphd3pbgatJVXhoNXwBbJFSatI5v pWKfMo06FIFjF6q0zEDQUmzGXxAYMuMAy/GkD2I+7NmJpoZFAgH3ON7E7+Z5sRhVRxl/ 0LiA== 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; dmarc=fail (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=microchip.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id r22si11779948eji.521.2020.09.22.23.42.50; Tue, 22 Sep 2020 23:43:15 -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; dmarc=fail (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=microchip.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726763AbgIWGjl (ORCPT + 99 others); Wed, 23 Sep 2020 02:39:41 -0400 Received: from mail.kernel.org ([198.145.29.99]:49530 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726608AbgIWGjl (ORCPT ); Wed, 23 Sep 2020 02:39:41 -0400 Received: from sekiro (amontpellier-556-1-154-164.w109-210.abo.wanadoo.fr [109.210.130.164]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id B305021D43; Wed, 23 Sep 2020 06:39:39 +0000 (UTC) Date: Wed, 23 Sep 2020 08:39:36 +0200 From: Ludovic Desroches To: Pavel Machek Cc: linux-kernel@vger.kernel.org, dmaengine@vger.kernel.org, linux-arm-kernel@lists.infradead.org, dan.j.williams@intel.com, vkoul@kernel.org, stable@vger.kernel.org, Greg KH Subject: Re: [PATCH 4.19] dmaengine: at_hdmac: Fix memory leak Message-ID: <20200923063936.zs6yg7vb4zw4hzuf@sekiro> References: <20200920082838.GA813@amd> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20200920082838.GA813@amd> Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Sun, Sep 20, 2020 at 10:28:38AM +0200, Pavel Machek wrote: > Date: Sun, 20 Sep 2020 10:28:38 +0200 > From: Pavel Machek > To: linux-kernel@vger.kernel.org, dmaengine@vger.kernel.org, > linux-arm-kernel@lists.infradead.org, dan.j.williams@intel.com, > vkoul@kernel.org, ludovic.desroches@microchip.com, stable@vger.kernel.org, > Greg KH > Subject: [PATCH 4.19] dmaengine: at_hdmac: Fix memory leak > > > This fixes memory leak in at_hdmac. Mainline does not have the same > problem. > > Signed-off-by: Pavel Machek (CIP) Acked-by: Ludovic Desroches Thanks. > > 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; > + } > > atchan = to_at_dma_chan(chan); > atchan->per_if = dma_spec->args[0] & 0xff; > > -- > (english) http://www.livejournal.com/~pavelmachek > (cesky, pictures) http://atrey.karlin.mff.cuni.cz/~pavel/picture/horses/blog.html