greybus: sdio: fix call to stop command if no data exist

If data is not available the stop command could dereference NULL.
Fetch the stop command directly from the request instead.

Signed-off-by: Rui Miguel Silva <rui.silva@linaro.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@google.com>
This commit is contained in:
Rui Miguel Silva 2015-07-02 19:11:33 +01:00 committed by Greg Kroah-Hartman
parent 08ccc9be68
commit 7a5cd5aea2

View file

@ -443,8 +443,8 @@ static void gb_sdio_mrq_work(struct work_struct *work)
goto done;
}
if (mrq->data->stop) {
ret = gb_sdio_command(host, mrq->data->stop);
if (mrq->stop) {
ret = gb_sdio_command(host, mrq->stop);
if (ret < 0)
goto done;
}