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

Commit 88b8d9a8 authored by Manuel Lauss's avatar Manuel Lauss Committed by Pierre Ossman
Browse files

au1xmmc: abort requests early if no card is present.



Don't process an MMC request if no card is present.

Signed-off-by: default avatarManuel Lauss <mano@roarinelk.homelinux.net>
Signed-off-by: default avatarPierre Ossman <drzeus@drzeus.cx>
parent 5c0a889d
Loading
Loading
Loading
Loading
+7 −0
Original line number Diff line number Diff line
@@ -697,6 +697,13 @@ static void au1xmmc_request(struct mmc_host* mmc, struct mmc_request* mrq)
	host->mrq = mrq;
	host->status = HOST_S_CMD;

	/* fail request immediately if no card is present */
	if (0 == au1xmmc_card_inserted(host)) {
		mrq->cmd->error = -ENOMEDIUM;
		au1xmmc_finish_request(host);
		return;
	}

	if (mrq->data) {
		FLUSH_FIFO(host);
		ret = au1xmmc_prepare_data(host, mrq->data);