diff options
| -rw-r--r-- | drivers/mmc/host/cqhci.c | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/drivers/mmc/host/cqhci.c b/drivers/mmc/host/cqhci.c index bd9a59bc0e31..a8af682a9182 100644 --- a/drivers/mmc/host/cqhci.c +++ b/drivers/mmc/host/cqhci.c | |||
| @@ -217,12 +217,21 @@ static int cqhci_host_alloc_tdl(struct cqhci_host *cq_host) | |||
| 217 | cq_host->desc_size, | 217 | cq_host->desc_size, |
| 218 | &cq_host->desc_dma_base, | 218 | &cq_host->desc_dma_base, |
| 219 | GFP_KERNEL); | 219 | GFP_KERNEL); |
| 220 | if (!cq_host->desc_base) | ||
| 221 | return -ENOMEM; | ||
| 222 | |||
| 220 | cq_host->trans_desc_base = dmam_alloc_coherent(mmc_dev(cq_host->mmc), | 223 | cq_host->trans_desc_base = dmam_alloc_coherent(mmc_dev(cq_host->mmc), |
| 221 | cq_host->data_size, | 224 | cq_host->data_size, |
| 222 | &cq_host->trans_desc_dma_base, | 225 | &cq_host->trans_desc_dma_base, |
| 223 | GFP_KERNEL); | 226 | GFP_KERNEL); |
| 224 | if (!cq_host->desc_base || !cq_host->trans_desc_base) | 227 | if (!cq_host->trans_desc_base) { |
| 228 | dmam_free_coherent(mmc_dev(cq_host->mmc), cq_host->desc_size, | ||
| 229 | cq_host->desc_base, | ||
| 230 | cq_host->desc_dma_base); | ||
| 231 | cq_host->desc_base = NULL; | ||
| 232 | cq_host->desc_dma_base = 0; | ||
| 225 | return -ENOMEM; | 233 | return -ENOMEM; |
| 234 | } | ||
| 226 | 235 | ||
| 227 | pr_debug("%s: cqhci: desc-base: 0x%p trans-base: 0x%p\n desc_dma 0x%llx trans_dma: 0x%llx\n", | 236 | pr_debug("%s: cqhci: desc-base: 0x%p trans-base: 0x%p\n desc_dma 0x%llx trans_dma: 0x%llx\n", |
| 228 | mmc_hostname(cq_host->mmc), cq_host->desc_base, cq_host->trans_desc_base, | 237 | mmc_hostname(cq_host->mmc), cq_host->desc_base, cq_host->trans_desc_base, |
