diff options
author | Grazvydas Ignotas <notasas@gmail.com> | 2012-04-10 21:04:34 -0400 |
---|---|---|
committer | David Woodhouse <David.Woodhouse@intel.com> | 2012-05-13 23:52:10 -0400 |
commit | d7efe2281db53544400ac83160a79cf8925598d9 (patch) | |
tree | b477c26b2f31adfce60268c12b11403879661212 /drivers | |
parent | 8da8ba2ea6ad52ea8558384f38586b0c1a516e9d (diff) |
mtd: omap2: fix resource leak in prefetch-busy path
If prefetch engine is busy, current code "forgets" to call
dma_unmap_single(), which results in a deadlock later, so add it.
Signed-off-by: Grazvydas Ignotas <notasas@gmail.com>
Signed-off-by: Artem Bityutskiy <artem.bityutskiy@linux.intel.com>
Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/mtd/nand/omap2.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/drivers/mtd/nand/omap2.c b/drivers/mtd/nand/omap2.c index c2b0bba9d8b3..ab56069fa31f 100644 --- a/drivers/mtd/nand/omap2.c +++ b/drivers/mtd/nand/omap2.c | |||
@@ -402,7 +402,7 @@ static inline int omap_nand_dma_transfer(struct mtd_info *mtd, void *addr, | |||
402 | PREFETCH_FIFOTHRESHOLD_MAX, 0x1, len, is_write); | 402 | PREFETCH_FIFOTHRESHOLD_MAX, 0x1, len, is_write); |
403 | if (ret) | 403 | if (ret) |
404 | /* PFPW engine is busy, use cpu copy method */ | 404 | /* PFPW engine is busy, use cpu copy method */ |
405 | goto out_copy; | 405 | goto out_copy_unmap; |
406 | 406 | ||
407 | init_completion(&info->comp); | 407 | init_completion(&info->comp); |
408 | 408 | ||
@@ -421,6 +421,8 @@ static inline int omap_nand_dma_transfer(struct mtd_info *mtd, void *addr, | |||
421 | dma_unmap_single(&info->pdev->dev, dma_addr, len, dir); | 421 | dma_unmap_single(&info->pdev->dev, dma_addr, len, dir); |
422 | return 0; | 422 | return 0; |
423 | 423 | ||
424 | out_copy_unmap: | ||
425 | dma_unmap_single(&info->pdev->dev, dma_addr, len, dir); | ||
424 | out_copy: | 426 | out_copy: |
425 | if (info->nand.options & NAND_BUSWIDTH_16) | 427 | if (info->nand.options & NAND_BUSWIDTH_16) |
426 | is_write == 0 ? omap_read_buf16(mtd, (u_char *) addr, len) | 428 | is_write == 0 ? omap_read_buf16(mtd, (u_char *) addr, len) |