mirror of https://gitee.com/openkylin/linux.git
greybus: sdio: correct the usage of mmc request in work queues handler
The mmc request should assigned before use. Then It should avoid freeing before using in mmc_request_done(). Signed-off-by: Phong Tran <tranmanphong@gmail.com> Reviewed-by: Rui Miguel Silva <rui.silva@linaro.org> Reviewed-by: Mark Greer <mgreer@animalcreek.com> Signed-off-by: Greg Kroah-Hartman <gregkh@google.com>
This commit is contained in:
parent
9b86bdf96e
commit
93a99e8a10
|
@ -387,13 +387,18 @@ static void gb_sdio_mrq_work(struct work_struct *work)
|
|||
host = container_of(work, struct gb_sdio_host, mrqwork);
|
||||
|
||||
mutex_lock(&host->lock);
|
||||
mrq = host->mrq;
|
||||
if (!mrq) {
|
||||
mutex_unlock(&host->lock);
|
||||
dev_err(mmc_dev(host->mmc), "mmc request is NULL");
|
||||
return;
|
||||
}
|
||||
|
||||
if (host->removed) {
|
||||
mrq->cmd->error = -ESHUTDOWN;
|
||||
goto done;
|
||||
}
|
||||
|
||||
mrq = host->mrq;
|
||||
|
||||
if (mrq->sbc) {
|
||||
ret = gb_sdio_command(host, mrq->sbc);
|
||||
if (ret < 0)
|
||||
|
@ -417,7 +422,7 @@ static void gb_sdio_mrq_work(struct work_struct *work)
|
|||
}
|
||||
|
||||
done:
|
||||
mrq = NULL;
|
||||
host->mrq = NULL;
|
||||
mutex_unlock(&host->lock);
|
||||
mmc_request_done(host->mmc, mrq);
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue