summaryrefslogtreecommitdiff
path: root/drivers
diff options
context:
space:
mode:
authorJason Liu <r64343@freescale.com>2010-08-11 12:39:06 +0800
committerAlan Tull <r80115@freescale.com>2010-09-25 09:50:50 -0500
commite61ffd25a15b8825dc0cd8aecec986173ef72801 (patch)
treec0b454dc3f347fb0d5058595645f5e0e87601366 /drivers
parent632c358599889f6e97201fa7aa8baa5e21d82753 (diff)
ENGR00126158 GPMI: Fix error handling when no NAND found
There will be one oops when no NAND found for GPMI, This patch fix it Signed-off-by:Jason Liu <r64343@freescale.com>
Diffstat (limited to 'drivers')
-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 e6b5efb78c72..83f5086f37f3 100644
--- a/drivers/mtd/nand/gpmi-nfc/gpmi-nfc-mil.c
+++ b/drivers/mtd/nand/gpmi-nfc/gpmi-nfc-mil.c
@@ -2571,11 +2571,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;