[patch v2 09/16] MMC: S3C24XX: Ensure host->mrq->data is valid

Ben Dooks
2008-06-16T14:38:40Z

[-- Attachment #1: simtec/s3c24xx-sdmmc-piotasklet-crashfix.patch --]
[-- Type: text/plain, Size: 799 bytes --]

Fix a crash if host->mrq->data is NULL on ending a transfer.

Signed-off-by: Ben Dooks <ben-linux@fluff.org>

Index: linux-2.6.26-rc5-q2/drivers/mmc/host/s3cmci.c
===================================================================
--- linux-2.6.26-rc5-q2.orig/drivers/mmc/host/s3cmci.c 2008-06-08 13:59:17.000000000 +0100
+++ linux-2.6.26-rc5-q2/drivers/mmc/host/s3cmci.c 2008-06-08 13:59:20.000000000 +0100
@@ -344,7 +344,8 @@ static void pio_tasklet(unsigned long da
(host->pio_active == XFER_READ) ? "read" : "write",
host->pio_count, host->pio_words);

- host->mrq->data->error = MMC_ERR_DMA;
+ if (host->mrq->data)
+ host->mrq->data->error = MMC_ERR_DMA;
}

finalize_request(host);