Skip to content

Commit

Permalink
mmc: mmci: simplify err check in mmci_post_request
Browse files Browse the repository at this point in the history
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 <[email protected]>
Acked-by: Linus Walleij <[email protected]>
Signed-off-by: Chris Ball <[email protected]>
  • Loading branch information
perfor authored and cjb committed Oct 26, 2011
1 parent 7c8a282 commit 8e3336b
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion drivers/mmc/host/mmci.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit 8e3336b

Please sign in to comment.