aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGuennadi Liakhovetski <g.liakhovetski@gmx.de>2012-08-22 02:49:47 -0400
committerChris Ball <cjb@laptop.org>2012-12-06 13:54:35 -0500
commit91ab252ac5a5c3461dd6910797611e9172626aed (patch)
tree8e1dfa1c86e2221997e4918203615782404a663c
parent6984f3c31bb57cb7491dbec1be44b74bd00f4648 (diff)
mmc: sh-mmcif: avoid oops on spurious interrupts (second try)
On some systems, e.g., kzm9g, MMCIF interfaces can produce spurious interrupts without any active request. To prevent the Oops, that results in such cases, don't dereference the mmc request pointer until we make sure, that we are indeed processing such a request. Reported-by: Tetsuyuki Kobayashi <koba@kmckk.co.jp> Signed-off-by: Guennadi Liakhovetski <g.liakhovetski@gmx.de> Tested-by: Tetsuyuki Kobayashi <koba@kmckk.co.jp> Cc: stable@vger.kernel.org Signed-off-by: Chris Ball <cjb@laptop.org>
-rw-r--r--drivers/mmc/host/sh_mmcif.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/drivers/mmc/host/sh_mmcif.c b/drivers/mmc/host/sh_mmcif.c
index 43cd0b54db07..7eaee3eeb6b2 100644
--- a/drivers/mmc/host/sh_mmcif.c
+++ b/drivers/mmc/host/sh_mmcif.c
@@ -1104,7 +1104,6 @@ static irqreturn_t sh_mmcif_irqt(int irq, void *dev_id)
1104{ 1104{
1105 struct sh_mmcif_host *host = dev_id; 1105 struct sh_mmcif_host *host = dev_id;
1106 struct mmc_request *mrq = host->mrq; 1106 struct mmc_request *mrq = host->mrq;
1107 struct mmc_data *data = mrq->data;
1108 1107
1109 cancel_delayed_work_sync(&host->timeout_work); 1108 cancel_delayed_work_sync(&host->timeout_work);
1110 1109
@@ -1152,13 +1151,14 @@ static irqreturn_t sh_mmcif_irqt(int irq, void *dev_id)
1152 case MMCIF_WAIT_FOR_READ_END: 1151 case MMCIF_WAIT_FOR_READ_END:
1153 case MMCIF_WAIT_FOR_WRITE_END: 1152 case MMCIF_WAIT_FOR_WRITE_END:
1154 if (host->sd_error) 1153 if (host->sd_error)
1155 data->error = sh_mmcif_error_manage(host); 1154 mrq->data->error = sh_mmcif_error_manage(host);
1156 break; 1155 break;
1157 default: 1156 default:
1158 BUG(); 1157 BUG();
1159 } 1158 }
1160 1159
1161 if (host->wait_for != MMCIF_WAIT_FOR_STOP) { 1160 if (host->wait_for != MMCIF_WAIT_FOR_STOP) {
1161 struct mmc_data *data = mrq->data;
1162 if (!mrq->cmd->error && data && !data->error) 1162 if (!mrq->cmd->error && data && !data->error)
1163 data->bytes_xfered = 1163 data->bytes_xfered =
1164 data->blocks * data->blksz; 1164 data->blocks * data->blksz;