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=-12.8 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH, MAILING_LIST_MULTI,SIGNED_OFF_BY,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED, USER_AGENT_SANE_1 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 A5D9AC43465 for ; Sun, 20 Sep 2020 08:30:22 +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 36F2E2084C for ; Sun, 20 Sep 2020 08:30:22 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="LfseY55/" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 36F2E2084C Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=ucw.cz 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-Type: List-Subscribe:List-Help:List-Post:List-Archive:List-Unsubscribe:List-Id: MIME-Version:Message-ID:Subject:To:From:Date:Reply-To:Cc: Content-Transfer-Encoding:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:In-Reply-To: References:List-Owner; bh=lZ2WTlKSHAK6nc+O6OX9KsRZKTzjxY5ZpvXn3TS6Eqw=; b=Lfs eY55/bT5NNToA05pSl/LhTRMCTV/l/RW6CUEzpNY04QZNvVhFRU4tH9C/+fSJeUpMd3US5T3JlBzL QZl7OurRkWpGsROpOER0wFcpJTnhrYB2HVBPF3xhuIIzsZRoEqMBQSTt2rDIM4z379LhEM02JDuqF mPDyUPc7h4dgYz8hikeQ5KGFI9wgbCDjaTV/ny5Qx8bhPdJWqlJBHijbZ6L0T+S6T1JRflSpIV2w0 SlBD4GGltWEZn9wBpjMmENW/AewLAGMMzwk2TFBxzTqzp/m0cbYA/QteP6zYkjrov2+BkXMSjJZET OiX7zv0z5uhEcJQjTRiqW0jhhrqzjCw==; Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1kJuiF-0002O4-Lj; Sun, 20 Sep 2020 08:28:47 +0000 Received: from jabberwock.ucw.cz ([46.255.230.98]) by merlin.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1kJuiD-0002NV-1C for linux-arm-kernel@lists.infradead.org; Sun, 20 Sep 2020 08:28:46 +0000 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 User-Agent: Mutt/1.5.23 (2014-03-12) X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20200920_042845_189097_2C566FBC X-CRM114-Status: GOOD ( 12.82 ) 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: , Content-Type: multipart/mixed; boundary="===============4124409738370034113==" Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org --===============4124409738370034113== Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="XsQoSWH+UP9D9v3l" Content-Disposition: inline --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-- --===============4124409738370034113== Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Disposition: inline _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel --===============4124409738370034113==--