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: 1107912 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by demeter2.kernel.org (8.14.4/8.14.4) with ESMTP id p7TDac6t029554 for ; Mon, 29 Aug 2011 13:36:48 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753694Ab1H2Ngs (ORCPT ); Mon, 29 Aug 2011 09:36:48 -0400 Received: from mail-bw0-f46.google.com ([209.85.214.46]:33306 "EHLO mail-bw0-f46.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753681Ab1H2Ngr (ORCPT ); Mon, 29 Aug 2011 09:36:47 -0400 Received: by mail-bw0-f46.google.com with SMTP id 11so4160433bke.19 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> Sender: linux-mmc-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-mmc@vger.kernel.org X-Greylist: IP, sender and recipient auto-whitelisted, not delayed by milter-greylist-4.2.6 (demeter2.kernel.org [140.211.167.43]); Mon, 29 Aug 2011 13:36:48 +0000 (UTC) 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;