Received: by 2002:a05:6a10:22f:0:0:0:0 with SMTP id 15csp2377765pxk; Sun, 20 Sep 2020 01:31:37 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxc1Vqx+7yKYlpDQsc86P5CIGj8L6yTrEtc1kNPDiOKv5SY0tGDU7Y3xUwNdoxOKKfWoR5D X-Received: by 2002:a17:906:3ca2:: with SMTP id b2mr45600598ejh.460.1600590697073; Sun, 20 Sep 2020 01:31:37 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1600590697; cv=none; d=google.com; s=arc-20160816; b=AisfvuejYwm8mKQ83VEDAp1Kk3tSvmTgFU/DbZXNDytsQh1r31eLzYXC1bqgLfoNZw bIvIZSxxmE2aE+hXNL4bhjS4QcQmhkzUGykkuuMkmhjpShm3R2r7nc04jrxvQB8+jGBw ChFRkQ5vK8MtElw+ZT6Q95axmjp90wm2u5P7jJZ+IcO9wUOMCRg0+d84P+zYZ4WDoOqe hDbEV3K4ZbG4WHOXTR0ye0OKpk0yWwiv1FkVCCWgPnWmyzKUBFVmQOHBYHlJmgFskvis 5Ywmn6QfBIYM+N1phzJS3rCy+TVkFSbzi5sqSbZDLYqHFXqrjEKlyKcM+GCEL/l77rmp 5kUQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:user-agent:content-disposition:mime-version :message-id:subject:to:from:date; bh=XyU+lMUHbr8re1mZoz0YLykmI7bU1wnDi1uoQT7g85c=; b=SIS7Ke/Mfbl5XvnPlkZnM5giqW4aX+/XkYnyAT0BGEaN2Bc8Zk0TXiFQkbS9Iv9+OM U5aT3xJmq9g3HvoVsWd9y18Wki/0fRIs+9tYXa3i/3AxvHRIT6lHI+huhgr3hmFTbXwr MW86gjoLgbx2vCBU+VqiVnFf5qghfnOVm3VDFXUT0aCRVHp6DO/DwqabXwTzSxkDmT0p 7GMDc0TXfhP+UgUpcDTkIBBzRZlEzv4Uzga+cbYehSlktFd4tZLC0wZ0jMiFtPQZEW18 KN3WqiYiiuOh8MjMRkqgTrMlN/HW91iHfA96T8vXLMtSKYvRCLeeSx9QNkBD22NybNXY JEZQ== 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 c11si5818561ejb.541.2020.09.20.01.31.13; Sun, 20 Sep 2020 01:31:37 -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 S1726376AbgITI2n (ORCPT + 99 others); Sun, 20 Sep 2020 04:28:43 -0400 Received: from jabberwock.ucw.cz ([46.255.230.98]:59106 "EHLO jabberwock.ucw.cz" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726216AbgITI2m (ORCPT ); Sun, 20 Sep 2020 04:28:42 -0400 Received: by jabberwock.ucw.cz (Postfix, from userid 1017) id BE7501C0B94; Sun, 20 Sep 2020 10:28:39 +0200 (CEST) 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 Message-ID: <20200920082838.GA813@amd> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="XsQoSWH+UP9D9v3l" Content-Disposition: inline User-Agent: Mutt/1.5.23 (2014-03-12) Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org --XsQoSWH+UP9D9v3l Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable 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_phand= le_args *dma_spec, atslave->dma_dev =3D &dmac_pdev->dev; =20 chan =3D dma_request_channel(mask, at_dma_filter, atslave); - if (!chan) + if (!chan) { + kfree(atslave); return NULL; + } =20 atchan =3D to_at_dma_chan(chan); atchan->per_if =3D dma_spec->args[0] & 0xff; --=20 (english) http://www.livejournal.com/~pavelmachek (cesky, pictures) http://atrey.karlin.mff.cuni.cz/~pavel/picture/horses/blo= g.html --XsQoSWH+UP9D9v3l Content-Type: application/pgp-signature; name="signature.asc" Content-Description: Digital signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v1 iEYEARECAAYFAl9nErYACgkQMOfwapXb+vI9BACgw3g6qlJ65PvDed0Jfrfa0voB nFMAoIHRW+dHA2qeUSnIg4WPsR58F/K2 =U2YD -----END PGP SIGNATURE----- --XsQoSWH+UP9D9v3l--