From patchwork Wed Nov 13 07:44:46 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dan Carpenter X-Patchwork-Id: 3177311 X-Patchwork-Delegate: vinod.koul@intel.com Return-Path: X-Original-To: patchwork-dmaengine@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork2.web.kernel.org (Postfix) with ESMTP id E7A80C045B for ; Wed, 13 Nov 2013 07:45:05 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id CC0C220594 for ; Wed, 13 Nov 2013 07:45:04 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 7945C20320 for ; Wed, 13 Nov 2013 07:45:03 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1758306Ab3KMHpB (ORCPT ); Wed, 13 Nov 2013 02:45:01 -0500 Received: from userp1040.oracle.com ([156.151.31.81]:49009 "EHLO userp1040.oracle.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1757893Ab3KMHpB (ORCPT ); Wed, 13 Nov 2013 02:45:01 -0500 Received: from acsinet22.oracle.com (acsinet22.oracle.com [141.146.126.238]) by userp1040.oracle.com (Sentrion-MTA-4.3.1/Sentrion-MTA-4.3.1) with ESMTP id rAD7iwI3008465 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Wed, 13 Nov 2013 07:44:59 GMT Received: from aserz7021.oracle.com (aserz7021.oracle.com [141.146.126.230]) by acsinet22.oracle.com (8.14.4+Sun/8.14.4) with ESMTP id rAD7ivet003876 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Wed, 13 Nov 2013 07:44:57 GMT Received: from abhmp0006.oracle.com (abhmp0006.oracle.com [141.146.116.12]) by aserz7021.oracle.com (8.14.4+Sun/8.14.4) with ESMTP id rAD7ivGU002766; Wed, 13 Nov 2013 07:44:57 GMT Received: from elgon.mountain (/41.202.233.184) by default (Oracle Beehive Gateway v4.0) with ESMTP ; Tue, 12 Nov 2013 23:44:56 -0800 Date: Wed, 13 Nov 2013 10:44:46 +0300 From: Dan Carpenter To: Dan Williams Cc: Vinod Koul , dmaengine@vger.kernel.org, linux-kernel@vger.kernel.org, kernel-janitors@vger.kernel.org Subject: [patch] dmaengine: edma: double free on error in edma_prep_slave_sg() Message-ID: <20131113074446.GC25541@elgon.mountain> MIME-Version: 1.0 Content-Disposition: inline User-Agent: Mutt/1.5.21 (2010-09-15) X-Source-IP: acsinet22.oracle.com [141.146.126.238] Sender: dmaengine-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: dmaengine@vger.kernel.org X-Spam-Status: No, score=-6.9 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_HI, RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP We accidentally applied two correct but duplicative fixes for a memory leak here: 4b6271a64463 ('dma: edma: Fix memory leak') 2f6d8fad0a16 ('dma: edma.c: remove edma_desc leakage') Signed-off-by: Dan Carpenter --- To unsubscribe from this list: send the line "unsubscribe dmaengine" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html diff --git a/drivers/dma/edma.c b/drivers/dma/edma.c index ea4abaa..9c8103d 100644 --- a/drivers/dma/edma.c +++ b/drivers/dma/edma.c @@ -420,7 +420,6 @@ static struct dma_async_tx_descriptor *edma_prep_slave_sg( edma_alloc_slot(EDMA_CTLR(echan->ch_num), EDMA_SLOT_ANY); if (echan->slot[i] < 0) { - kfree(edesc); dev_err(dev, "Failed to allocate slot\n"); kfree(edesc); return NULL;