Received: by 2002:a25:ad19:0:0:0:0:0 with SMTP id y25csp12096970ybi; Fri, 26 Jul 2019 04:46:01 -0700 (PDT) X-Google-Smtp-Source: APXvYqyEXSOt5YZBPmrj/KsYJ6Ld4P6I05PsA/9R1oV1KLLLtS72kthAL68Fs+Csps2d5cDnrvsw X-Received: by 2002:a17:902:70c3:: with SMTP id l3mr94099826plt.92.1564141561478; Fri, 26 Jul 2019 04:46:01 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1564141561; cv=none; d=google.com; s=arc-20160816; b=IlfHIifZBOPWbdDlosHTawTvotP6jIlnUF+rT+3x8lrE5A86BxEA4MSo+pCn3Cz2j7 sdvB0Xec7n+aQiW/JkKp3qLooRZdYmDK0rZiJmPv3eH1ZgE9PZ7phwCTmUVJpvWIpERe L1x+U3vdiJ9mmQ7ukZEK2Q6jz3VdVaGB9gcUYnWnKujLDz1sUqMae5UfE5ImCEn7saj7 UHWYutbNGithZ1CNh8Cn0eK/g/eDv9KsngfCJSiLlCKlcF0ZrtzOF3JeOA9Fjm3MiMdG 5OM6/fYNT3kgALlBN3w+ScHO4vgojwQ3KVjGyn6LVtmW7WHao51VbnSW1Baqq/k7aurV awmA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:to:message-id:date:subject:cc:from :dkim-signature; bh=GZk1YBh8K1nF7b/BG0aJDKLlYWK7vgDFFQWFrUTZFzA=; b=NEGYyMzgJ5CiiMzzo7dvstQz+aTuX1FH4tJ4t4tGbJQfDbYFQu7Aczr3VziYL0VV9n i4OwSOqvPHhN0l4sJgKIAq5nzH3lW5aYmI9NA0iIjZuh2T/Jz9mDJxbuWFs6hpTL92is vlrmlHWARQshUWvlXnto6fZFlJO3LM0eJz6+MKp6Pflc+ydhBu7NnY4mp6MzfOQCoQ+A LhoPEva4qfa11njr79UdxFaCMEWmJg/GKj9QzQEUDlKCr9OvT6iumgIta9xc90uVTwv/ XcVzTpbT42D6Zj7WOlUG0p6KTE+2z5vDDMRsuue62k4KlcPcq3NPwdlB2BjxquXlA3Bj 5KbQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@gmail.com header.s=20161025 header.b=c6gTe21N; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id k32si18161798pjb.11.2019.07.26.04.45.41; Fri, 26 Jul 2019 04:46:01 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=fail header.i=@gmail.com header.s=20161025 header.b=c6gTe21N; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726751AbfGZLAF (ORCPT + 99 others); Fri, 26 Jul 2019 07:00:05 -0400 Received: from mail-pl1-f196.google.com ([209.85.214.196]:42844 "EHLO mail-pl1-f196.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725842AbfGZLAE (ORCPT ); Fri, 26 Jul 2019 07:00:04 -0400 Received: by mail-pl1-f196.google.com with SMTP id ay6so24673271plb.9; Fri, 26 Jul 2019 04:00:04 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id; bh=GZk1YBh8K1nF7b/BG0aJDKLlYWK7vgDFFQWFrUTZFzA=; b=c6gTe21NfZlHeMmzBg1Z75RsvgsPNWl9dWqZyeki1vTtEStPyxBnNCiGiMBiDP0xWu KjxYYQyZujbishNMkirEBOjr/FJ5NObejW3xu/FLWt72aMHSXN38DE0AK7Nj3ywn0sc2 M7QupNSZVxzNUTBnTqKgXWZwfPGyFqHqCW++ZTZ+IuayQ3byxx7dzA8MnDFrlBSNGVpx ICtTcxqWNXy/0k9pv7mJXiTB7mYuqtlEQTplUuJTiCYjB831EiXxGrucawDOa3KiA6fB pyEEQYPipeh3XJ7JCFuJepY8vv9Ru8Tq2Bq08Ana1vSiy8lVwTzyguTF1zpk2NH5Rwkn V6oQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id; bh=GZk1YBh8K1nF7b/BG0aJDKLlYWK7vgDFFQWFrUTZFzA=; b=Z1VhsZC04UPeOzYPb+DUCBDOazcpFDbjDWC2+qVIF69ZqO/ojhtZaK52HHQT0Dk411 uRXdYtzNgKS9Ko3eQHYjNC1OPy3GCvn8yW2h3u6Xhq3yQD729k1bUnxTWND/9spHgKhU M9DuhkvZ296Q3wQlhhgVNhwWgqu0TOAnv/iNHdRp4D3PlQuSdRkMsELh96wpl3AXHzac XNHi0AcBNgXU/FUT04IKCl5NBtDTplWGLn9FHTKqdXdLMVMsbq18vZ/kgIlte+AArBB+ cOhTExHyMOjsRV6Em9idxiDQ308v6BRAmO4x9X4UP3irqU3tw3S58AsmEUXV5WOOMNT3 kSag== X-Gm-Message-State: APjAAAUOtrB7lu6Bn9qcINpR3tKpL0+Cop7xju5+vJY+JPPcgH1afuLH N//e/7xRLcyp1Nbyqfqqsj0= X-Received: by 2002:a17:902:9a85:: with SMTP id w5mr95803057plp.221.1564138803975; Fri, 26 Jul 2019 04:00:03 -0700 (PDT) Received: from hfq-skylake.ipads-lab.se.sjtu.edu.cn ([202.120.40.82]) by smtp.googlemail.com with ESMTPSA id t10sm51967367pjr.13.2019.07.26.04.00.01 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 26 Jul 2019 04:00:03 -0700 (PDT) From: Fuqian Huang Cc: Vinod Koul , dmaengine@vger.kernel.org, linux-kernel@vger.kernel.org, Fuqian Huang Subject: [PATCH] dmaengine: pl330: use the same attributes when freeing pl330->mcode_cpu Date: Fri, 26 Jul 2019 18:59:47 +0800 Message-Id: <20190726105947.25342-1-huangfq.daxian@gmail.com> X-Mailer: git-send-email 2.11.0 To: unlisted-recipients:; (no To-header on input) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org In function dmac_alloc_resources(), pl330->mcode_cpu is allocated using dma_alloc_attrs() but freed with dma_free_coherent(). Use the correct dma_free_attrs() function to free pl330->mcode_cpu. Signed-off-by: Fuqian Huang --- drivers/dma/pl330.c | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/drivers/dma/pl330.c b/drivers/dma/pl330.c index 1163af2ba4a3..6cce9ef61b29 100644 --- a/drivers/dma/pl330.c +++ b/drivers/dma/pl330.c @@ -1922,9 +1922,10 @@ static int dmac_alloc_resources(struct pl330_dmac *pl330) if (ret) { dev_err(pl330->ddma.dev, "%s:%d Can't to create channels for DMAC!\n", __func__, __LINE__); - dma_free_coherent(pl330->ddma.dev, + dma_free_attrs(pl330->ddma.dev, chans * pl330->mcbufsz, - pl330->mcode_cpu, pl330->mcode_bus); + pl330->mcode_cpu, pl330->mcode_bus, + DMA_ATTR_PRIVILEGED); return ret; } @@ -2003,9 +2004,9 @@ static void pl330_del(struct pl330_dmac *pl330) /* Free DMAC resources */ dmac_free_threads(pl330); - dma_free_coherent(pl330->ddma.dev, + dma_free_attrs(pl330->ddma.dev, pl330->pcfg.num_chan * pl330->mcbufsz, pl330->mcode_cpu, - pl330->mcode_bus); + pl330->mcode_bus, DMA_ATTR_PRIVILEGED); } /* forward declaration */ -- 2.11.0