Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 4cbd5224 authored by Kouichi Tomita's avatar Kouichi Tomita Committed by Ulf Hansson
Browse files

mmc: sh_mmcif: Move dev_err() of mmcif_timeout_work()



If interruption of command already occurred, mrq pointer in dev_err()
would refer to NULL, because the host-state is changed to STATE_IDLE
and mrq pointer is changed to NULL by interrupt handler.
Therefore dev_err is moved after checking STATE_IDLE.

Signed-off-by: default avatarKouichi Tomita <kouichi.tomita.yn@renesas.com>
Signed-off-by: default avatarYoshihiro Kaneko <ykaneko0929@gmail.com>
Signed-off-by: default avatarUlf Hansson <ulf.hansson@linaro.org>
parent daa3054f
Loading
Loading
Loading
Loading
+3 −3
Original line number Diff line number Diff line
@@ -1312,15 +1312,15 @@ static void mmcif_timeout_work(struct work_struct *work)
		/* Don't run after mmc_remove_host() */
		return;

	dev_err(&host->pd->dev, "Timeout waiting for %u on CMD%u\n",
		host->wait_for, mrq->cmd->opcode);

	spin_lock_irqsave(&host->lock, flags);
	if (host->state == STATE_IDLE) {
		spin_unlock_irqrestore(&host->lock, flags);
		return;
	}

	dev_err(&host->pd->dev, "Timeout waiting for %u on CMD%u\n",
		host->wait_for, mrq->cmd->opcode);

	host->state = STATE_TIMEOUT;
	spin_unlock_irqrestore(&host->lock, flags);