summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJason Liu <r64343@freescale.com>2010-08-11 12:39:06 +0800
committerFrank Li <Frank.Li@freescale.com>2010-08-11 13:45:17 +0800
commitc57e4f2be8c66cd40d8c8a40a907a5a051f973df (patch)
treea230244caa2ce88c0707e9af5665c50912795de1
parent66ed9d0b56a2cb56269b57ca0b9e659c28f6649b (diff)
ENGR00126158 GPMI: Fix error handling when no NAND foundrel-imx-2.6.31-10.08.01
There will be one oops when no NAND found for GPMI, This patch fix it Signed-off-by:Jason Liu <r64343@freescale.com> (cherry picked from commit 0fc02d10c3dc90051bfbbdd1208b79499f9329fd)
-rw-r--r--drivers/mtd/nand/gpmi-nfc/gpmi-nfc-mil.c11
1 files changed, 8 insertions, 3 deletions
diff --git a/drivers/mtd/nand/gpmi-nfc/gpmi-nfc-mil.c b/drivers/mtd/nand/gpmi-nfc/gpmi-nfc-mil.c
index ac86597a07d8..50ba771853a4 100644
--- a/drivers/mtd/nand/gpmi-nfc/gpmi-nfc-mil.c
+++ b/drivers/mtd/nand/gpmi-nfc/gpmi-nfc-mil.c
@@ -2574,11 +2574,16 @@ int gpmi_nfc_mil_init(struct gpmi_nfc_data *this)
exit_partitions:
nand_release(&mil->mtd);
exit_nand_scan:
- mil->cmd_virt = 0;
- mil->cmd_phys = ~0;
+ dma_free_coherent(dev,
+ this->nfc_geometry.payload_size_in_bytes,
+ mil->page_buffer_virt, mil->page_buffer_phys);
+ mil->page_buffer_virt = 0;
+ mil->page_buffer_phys = ~0;
exit_buf_allocation:
dma_free_coherent(dev, MIL_COMMAND_BUFFER_SIZE,
- mil->cmd_virt, mil->cmd_phys);
+ mil->cmd_virt, mil->cmd_phys);
+ mil->cmd_virt = 0;
+ mil->cmd_phys = ~0;
exit_cmd_allocation:
return error;