From patchwork Mon Aug 29 13:35:59 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Per Forlin X-Patchwork-Id: 3767 Return-Path: X-Original-To: patchwork@peony.canonical.com Delivered-To: patchwork@peony.canonical.com Received: from fiordland.canonical.com (fiordland.canonical.com [91.189.94.145]) by peony.canonical.com (Postfix) with ESMTP id 6332223F41 for ; Mon, 29 Aug 2011 13:36:48 +0000 (UTC) Received: from mail-bw0-f52.google.com (mail-bw0-f52.google.com [209.85.214.52]) by fiordland.canonical.com (Postfix) with ESMTP id 4EC25A18340 for ; Mon, 29 Aug 2011 13:36:48 +0000 (UTC) Received: by bkbzs2 with SMTP id zs2so6056103bkb.11 for ; Mon, 29 Aug 2011 06:36:48 -0700 (PDT) Received: by 10.223.88.214 with SMTP id b22mr5336411fam.5.1314625007927; Mon, 29 Aug 2011 06:36:47 -0700 (PDT) X-Forwarded-To: linaro-patchwork@canonical.com X-Forwarded-For: patch@linaro.org linaro-patchwork@canonical.com Delivered-To: patches@linaro.org Received: by 10.152.11.8 with SMTP id m8cs97197lab; Mon, 29 Aug 2011 06:36:47 -0700 (PDT) Received: by 10.204.141.133 with SMTP id m5mr227342bku.299.1314625007592; Mon, 29 Aug 2011 06:36:47 -0700 (PDT) Received: from mail-bw0-f50.google.com (mail-bw0-f50.google.com [209.85.214.50]) by mx.google.com with ESMTPS id x3si121821bkd.143.2011.08.29.06.36.47 (version=TLSv1/SSLv3 cipher=OTHER); Mon, 29 Aug 2011 06:36:47 -0700 (PDT) Received-SPF: neutral (google.com: 209.85.214.50 is neither permitted nor denied by best guess record for domain of per.forlin@linaro.org) client-ip=209.85.214.50; Authentication-Results: mx.google.com; spf=neutral (google.com: 209.85.214.50 is neither permitted nor denied by best guess record for domain of per.forlin@linaro.org) smtp.mail=per.forlin@linaro.org Received: by mail-bw0-f50.google.com with SMTP id zu5so5582992bkb.37 for ; Mon, 29 Aug 2011 06:36:47 -0700 (PDT) Received: by 10.204.139.3 with SMTP id c3mr2231940bku.305.1314625006795; Mon, 29 Aug 2011 06:36:46 -0700 (PDT) Received: from localhost.localdomain (c-c37f71d5.029-82-6c756e10.cust.bredbandsbolaget.se [213.113.127.195]) by mx.google.com with ESMTPS id m18sm1220341bkt.51.2011.08.29.06.36.44 (version=TLSv1/SSLv3 cipher=OTHER); Mon, 29 Aug 2011 06:36:45 -0700 (PDT) From: Per Forlin To: linaro-dev@lists.linaro.org, linux-arm-kernel@lists.infradead.org, linux-mmc@vger.kernel.org, Venkatraman S , Russell King - ARM Linux , Santosh , Balaji T Krishnamoorthy , Sourav Poddar Cc: Chris Ball , Per Forlin Subject: [PATCH 2/2] mmc: mmci: simplify err check in mmci_post_request Date: Mon, 29 Aug 2011 15:35:59 +0200 Message-Id: <1314624959-4634-3-git-send-email-per.forlin@linaro.org> X-Mailer: git-send-email 1.7.4.1 In-Reply-To: <1314624959-4634-1-git-send-email-per.forlin@linaro.org> References: <1314624959-4634-1-git-send-email-per.forlin@linaro.org> The error condition indicates that mmci_post_request() should cleanup after the mmci_pre_request(). In this case the resources allocated by device_prep_slave_sg() are freed by calling dmaengine_terminate_all(). dma_unmap_sg() should always be performed if the host_cookie is set. Signed-off-by: Per Forlin --- drivers/mmc/host/mmci.c | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-) diff --git a/drivers/mmc/host/mmci.c b/drivers/mmc/host/mmci.c index 56e9a41..40e4c05 100644 --- a/drivers/mmc/host/mmci.c +++ b/drivers/mmc/host/mmci.c @@ -529,7 +529,7 @@ static void mmci_post_request(struct mmc_host *mmc, struct mmc_request *mrq, if (chan) { if (err) dmaengine_terminate_all(chan); - if (err || data->host_cookie) + if (data->host_cookie) dma_unmap_sg(mmc_dev(host->mmc), data->sg, data->sg_len, dir); mrq->data->host_cookie = 0;