From patchwork Sun Jan 24 19:22:02 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: =?utf-8?b?TcOlbnMgUnVsbGfDpXJk?= X-Patchwork-Id: 8101041 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.29.136]) by patchwork2.web.kernel.org (Postfix) with ESMTP id 2077CBEEE5 for ; Sun, 24 Jan 2016 19:26:39 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 5F70120380 for ; Sun, 24 Jan 2016 19:26:38 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 83F702021A for ; Sun, 24 Jan 2016 19:26:37 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751572AbcAXT0W (ORCPT ); Sun, 24 Jan 2016 14:26:22 -0500 Received: from unicorn.mansr.com ([81.2.72.234]:59309 "EHLO unicorn.mansr.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754812AbcAXT0U (ORCPT ); Sun, 24 Jan 2016 14:26:20 -0500 Received: by unicorn.mansr.com (Postfix, from userid 51770) id A8AB41562F; Sun, 24 Jan 2016 19:26:19 +0000 (GMT) From: Mans Rullgard To: Viresh Kumar , Andy Shevchenko , Vinod Koul , linux-kernel@vger.kernel.org, dmaengine@vger.kernel.org Cc: Dan Williams Subject: [PATCH 15/15] dmaengine: dw: set cdesc to NULL when free cyclic transfers Date: Sun, 24 Jan 2016 19:22:02 +0000 Message-Id: <1453663322-14474-16-git-send-email-mans@mansr.com> X-Mailer: git-send-email 2.7.0 In-Reply-To: <1453663322-14474-1-git-send-email-mans@mansr.com> References: <1453663322-14474-1-git-send-email-mans@mansr.com> 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=ham 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 From: Andy Shevchenko To be sure we have the cyclic transfers already gone we set cdesc to NULL. It will prevent the double free. Signed-off-by: Andy Shevchenko Signed-off-by: Mans Rullgard --- drivers/dma/dw/core.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/drivers/dma/dw/core.c b/drivers/dma/dw/core.c index b6634adf24f9..5606deb7f060 100644 --- a/drivers/dma/dw/core.c +++ b/drivers/dma/dw/core.c @@ -1480,6 +1480,8 @@ void dw_dma_cyclic_free(struct dma_chan *chan) kfree(cdesc->desc); kfree(cdesc); + dwc->cdesc = NULL; + clear_bit(DW_DMA_IS_CYCLIC, &dwc->flags); } EXPORT_SYMBOL(dw_dma_cyclic_free);